Edgewall Software
Modify

Ticket #2763 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Add date to Trac's log

Reported by: dserodio@… Owned by: cboos
Priority: normal Milestone: 0.10
Component: general Version: 0.9.3
Severity: trivial Keywords: logging
Cc:
Release Notes:
API 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

Change History

comment:1 Changed 6 years ago by anonymous

Yes, please, this would be most useful.

comment:2 Changed 6 years ago by whiglyric@…

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 Changed 6 years ago by cboos

  • Milestone set to 0.10
  • Owner changed from jonas to cboos

comment:4 Changed 6 years ago by cboos

  • Resolution set to worksforme
  • Status changed from new to 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 Changed 6 years ago by cboos

  • Keywords logging added
  • Resolution worksforme deleted
  • Status changed from closed to reopened

Sorry, my mistake, I thought it worked for me...

comment:6 Changed 6 years ago by cboos

  • Severity changed from normal to 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 Changed 6 years ago by cboos

  • Resolution set to fixed
  • Status changed from reopened to 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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.