arista-eosplus / ztpserver

Full service ZTP Server implementation for bootstrapping Arista EOS nodes
Other
70 stars 33 forks source link

Server logs should be timestamped #63

Closed advornic closed 9 years ago

privateip commented 10 years ago

Fixed in 089e3ea

Server log message format is now configurable via ztpserver.conf. The default value is shown below and is configured in the [default] section.

[default]
console_logging_format = %(levelname)s: [%(module)s:%(lineno)d] %(message)s

Valid values should use the Python logging format as found here and here

advornic commented 10 years ago

Release note:

All server-side logs now contain a timestamp. Use 'ztps --debug' for verbose debug output.

phil-dileo commented 9 years ago

I don't see timestamped logs using --debug. Am I missing something?

DEBUG: [controller:648] 100000000588: processing action configure xmpp (variable substitution)
DEBUG: [controller:648] 100000000588: processing action configure MLAG, VARP, BGP (variable substitution)
DEBUG: [controller:648] 100000000588: processing action configure bgp interface automation event-handler (variable substitution)
DEBUG: [controller:648] 100000000588: processing action automate BGP peer interface config (variable substitution)

Does it need to be manually configured, like:

[default]
console_logging_format = %(levelname)s: %(asctime)s [%(module)s:%(lineno)d] %(message)s
advornic commented 9 years ago

Did you update "console_logging_format"?

advornic commented 9 years ago

The release note is a bit inaccurate.

advornic commented 9 years ago

Looks like:

[default] console_logging_format

is missing from ztpserver.conf

phil-dileo commented 9 years ago

For kicks I changed: cp = ConfigParser.ConfigParser() to: cp = ConfigParser.RawConfigParser()

and that fixed it. I don't think we're really using configparser interpolation for anything. Maybe we can be selective as to when we use raw reading. (https://github.com/arista-eosplus/ztpserver/blob/develop/ztpserver/config.py#L261)