Opened 20 years ago
Closed 20 years ago
#2763 closed defect (fixed)
Add date to Trac's log
| Reported by: | Owned by: | Christian Boos | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | general | Version: | 0.9.3 |
| Severity: | trivial | Keywords: | logging |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Currently, Trac log file is in the following format:
16:07:52 Trac[api] DEBUG: Updating wiki page index/Maglor/
The log file should also contain the date of the log messages, preferrably in ISO -8601 format, like:
2006-02-15 16:07:52 Trac[api] DEBUG: Updating wiki page index/Maglor/
Attachments (0)
Change History (7)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
In log.py, the date/time is formatted using %(asctime)s, which according to the Python documentation should include the date in the string by default. My system showed only the time, though. I added from datetime import datetime to the top of log.py, then rebuilt, and now the log file displays the date.
comment:3 by , 20 years ago
| Milestone: | → 0.10 |
|---|---|
| Owner: | changed from to |
comment:4 by , 20 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
Well actually I have the date right now, without the change (Linux w/Python 2.4, Windows w/Python 2.3 and 2.4, for both trunk and 0.9-stable).
Please reopen if this doesn't work for you for some reason on 0.10dev.
comment:5 by , 20 years ago
| Keywords: | logging added |
|---|---|
| Resolution: | worksforme |
| Status: | closed → reopened |
Sorry, my mistake, I thought it worked for me…
comment:6 by , 20 years ago
| Severity: | normal → trivial |
|---|
In [3171], the full time is shown even in DEBUG mode, as requested here.
I'll check the above on Unix, to see if there's a need to add the date
information for syslog type, or if that's done automatically by the
system, like on Windows using the winlog mode.
comment:7 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
Adding the date information for the file and stderr types
was enough: there's no need to add the date for the syslog type,
it's done by the system.



Yes, please, this would be most useful.