Opened 15 years ago
Last modified 3 years ago
#7820 new defect
[PATCH] Syslog Logging Not Working on FreeBSD — at Version 14
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Milestone: | next-dev-1.7.x |
Component: | general | Version: | none |
Severity: | normal | Keywords: | patch syslog freebsd bitesized logging |
Cc: | packet@… | Branch: | |
Release Notes: |
The logger can be configured using a Configuration File. |
||
API Changes: | |||
Internal Changes: |
Description
FreeBSD's syslog doesn't listen on /dev/log. It uses /var/run/log. Attached is a patch that allows you to specify the path to the UNIX socket instead of hardcoding it. It basically uses the logfile parameter, if it's None use /dev/log otherwise use it.
This bug affects all versions of Trac since about 0.7 it looks like.
Change History (19)
by , 15 years ago
Attachment: | syslog-path.patch added |
---|
by , 15 years ago
Attachment: | syslog-removepath.patch added |
---|
It's also possible to just remove the explicit path, and everything Just Works(tm) (at least on Python 2.5.2).
comment:1 by , 15 years ago
Milestone: | → 0.13 |
---|
My preference goes to attachment:syslog-removepath.patch.
Moving to 0.13 so that we don't have to bother with Python 2.3.
Should be verified for 2.4 as well, and on other platforms if needed (MacOS X?)
comment:3 by , 14 years ago
Cc: | added |
---|
According to the Python documentation:
- Passing no argument to
SysLogHandler
connects to the syslog via UDP port 514 onlocalhost
. - Specifying a string argument to
SysLogHandler
is only documented since 2.5, but is actually supported earlier (2.3 is the oldest I checked), and connects to a UNIX socket.
Considering this, we could support both variants, which comes closer to the first patch:
- Add a new parameter
logdest
. - If
logdest
starts withUDP:
, we pass the remaining string as a hostname and log via UDP to that host (which could be localhost). This would also allow logging remotely. - Otherwise,
logdest
is passed as a string and we log to a UNIX socket.
Re-using logfile
for this purpose is probably a bad idea, as the default value is trac.log
.
comment:5 by , 9 years ago
#11216 closed as a duplicate, additionally requesting the ability to set the syslog facility. ticket:11216:logging_config.patch adds a log_config
option which points to a dedicated logging configuration file.
by , 9 years ago
Attachment: | logging_config.patch added |
---|
Updated logging config patch. Adds the path, basename, project log format substitutions.
comment:6 by , 9 years ago
Cc: | added |
---|
by , 9 years ago
Attachment: | logging_config_adminpanel.patch added |
---|
Patch to the admin panel to add log_config support.
comment:7 by , 9 years ago
The patch looks pretty good. The biggest thing that will delay getting this committed is the lack of unit tests. If some unit tests were added this could be included in milestone:1.2.
comment:8 by , 9 years ago
See also #11874. The proposed changes in that ticket would be a good follow-on to this ticket.
comment:9 by , 9 years ago
Keywords: | logging added |
---|---|
Milestone: | next-major-releases → 1.2 |
comment:10 by , 9 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:11 by , 9 years ago
Minor refactorings in [14333:14336].
Revised changes in log:rjollos.git:t7820_logging_config. The revised changes avoid API changes that were present in attachment:logging_config.patch. Some of those changes have been deferred to #11874 (comment:10:ticket:11874).
I'll do more testing and add unit tests.
comment:13 by , 9 years ago
At least, we should use disable_existing_loggers=False
for the logging.config.fileConfig()
. I guess that call of the fileConfig()
would stop loggers of other environments with multiple projects.
See:
comment:14 by , 8 years ago
Release Notes: | modified (diff) |
---|
Patch for 0.10-stable and trunk. Overrides handling of UNIX socket path via logfile parameter.