Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a log file to be simply named "foobar.log" with no appended string #124

Closed
KevinLucidyne opened this issue Sep 22, 2016 · 2 comments
Closed

Comments

@KevinLucidyne
Copy link

I want to create a simple logfile of the form "foobar.log" without the time_pid_string being appended. I have tried

google::SetLogDestination(google::INFO, "/lti/ImageProcessing/Backbone/logs/foobar.log");
google::InitGoogleLogging("");

but this results in a log file of the form "foobar.logyyyymmdd-mmmmm.nnnn".

@AlexandreBurel
Copy link

In the file https://github.com/google/glog/blob/master/src/glog/logging.h.in on line 270 you will find the following indication:

// Unless otherwise specified, logs will be written to the filename
// "<program name>.<hostname>.<user name>.log.<severity level>.", followed
// by the date, time, and pid (you can't prevent the date, time, and pid
// from being in the filename).

Even if you use SetLogFilenameExtension(".log"), you will get "foobar.logyyyymmdd-mmmmm.nnnn"

And I totally agree with you, it would be great to have logs with the expected extension (especially for Windows users)

@sammcj
Copy link

sammcj commented Feb 15, 2018

Any progress with this?

It's not just really annoying, it can cause issues with logrotate, rsyslog management, logstash etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants