[SERVER-14816] Stop logging the date to STDOUT Created: 07/Aug/14  Updated: 31/May/16  Resolved: 20/May/16

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Tyler Brock Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

Adding the enormous date field when logging to STDOUT seems superfluous. The experience of starting mongod in an ad-hoc manner from the shell would be much nicer if we did not add it.

Here's an example where the STDOUT output has no date but the logfile does have the date:

$rethinkdb --log-file log
info: Running rethinkdb 1.13.3 (GCC 4.9.1)...
info: Running on Linux 3.15.7-1-ARCH x86_64
info: Using cache size of 10496 MB
info: Loading data from directory /home/tbrock/rethinkdb_data
info: Listening for intracluster connections on port 29015
info: Listening for client driver connections on port 28015
info: Listening for administrative HTTP connections on port 8080
info: Listening on addresses: 127.0.0.1, ::1
info: To fully expose RethinkDB on the network, bind to all addresses
info: by running rethinkdb with the `--bind all` command line option.
info: Server ready
^Cinfo: Server got SIGINT from pid 0, uid 0; shutting down...
info: Shutting down client connections...
info: All client connections closed.
info: Shutting down storage engine... (This may take a while if you had a lot of unflushed data in the writeback cache.)
info: Storage engine shut down.

$ cat log 
2014-08-07T10:06:59.511026618 0.161203s info: Running rethinkdb 1.13.3 (GCC 4.9.1)...
2014-08-07T10:06:59.520804548 0.170982s info: Running on Linux 3.15.7-1-ARCH x86_64
2014-08-07T10:06:59.520922399 0.171099s info: Using cache size of 10496 MB
2014-08-07T10:06:59.522787260 0.172964s info: Loading data from directory /home/tbrock/rethinkdb_data
2014-08-07T10:06:59.534747656 0.184924s info: Listening for intracluster connections on port 29015
2014-08-07T10:06:59.536013857 0.186191s info: Listening for client driver connections on port 28015
2014-08-07T10:06:59.536123801 0.186301s info: Listening for administrative HTTP connections on port 8080
2014-08-07T10:06:59.536131745 0.186308s info: Listening on addresses: 127.0.0.1, ::1
2014-08-07T10:06:59.536135997 0.186313s info: To fully expose RethinkDB on the network, bind to all addresses
2014-08-07T10:06:59.536138493 0.186315s info: by running rethinkdb with the `--bind all` command line option.
2014-08-07T10:06:59.536140742 0.186317s info: Server ready
2014-08-07T10:07:04.073260751 4.723438s info: Server got SIGINT from pid 0, uid 0; shutting down...
2014-08-07T10:07:04.073538778 4.723716s info: Shutting down client connections...
2014-08-07T10:07:04.074005996 4.724183s info: All client connections closed.
2014-08-07T10:07:04.074013599 4.724190s info: Shutting down storage engine... (This may take a while if you had a lot of unflushed data in the writeback cache.)
2014-08-07T10:07:04.074014574 4.724191s info: Storage engine shut down.



 Comments   
Comment by Mira Carey [ 20/May/16 ]

The format's been this way for long enough, we're not going to change it at this point.

Comment by Tyler Brock [ 09/Sep/14 ]

That is correct. If someone specifies a --logpath we should log to it AND STDOUT. However, this ticket is mostly about simply not printing the date to the STDOUT version. Presumably if you are watching the output live you don't need the time.

Comment by Ramon Fernandez Marina [ 08/Sep/14 ]

tyler@10gen.com, it seems that in the example above one can still get timestamps in a log file, so I could see how having a cleaner output in STDOUT can be nicer. Are you proposing we log both to STDOUT and a log file? Can you please elaborate on the use case?

Thanks,
Ramón.

Generated at Thu Feb 08 03:36:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.