sibojia / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

Configuration - Rolling File Log #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Implementation of Rolling File in glog ?

I would like know if with glog we can configure a rolling file.
That is to say , every day glog create a new log file automatically.

Send Log file ?
Can we configure glog to send a log file by email or write in a Data Base 

What version of the product are you using? On what operating system?
-glog-0.3.0
-Visual 2005
-XP & Vista

Please provide any additional information below:
I´m trying to compare glog with log4cxx.
It´s for a big project and I have to think about the enhancement of glog 
and the support.

Original issue reported on code.google.com by julien....@gmail.com on 20 Nov 2009 at 9:22

GoogleCodeExporter commented 9 years ago
Thanks for yours answers (in private)

Original comment by julien....@gmail.com on 2 Dec 2009 at 5:09

GoogleCodeExporter commented 9 years ago
Hello.
We are using glog too and facing the same problem.
Is there already any solution?
Any advice will be helpful.
Thank you.
Ivan

Original comment by I.Dun...@gmail.com on 30 Aug 2010 at 8:14

GoogleCodeExporter commented 9 years ago
I'm attaching a patch I made to add a RotateLogFiles() API to glog. I use this 
with a SIGHUP handler and an external program like logrotate to handle rotating 
log files. It would certainly be nice though if glog was as flexible as 
log4j/log4cxx in this respect.

I miss the log4cxx feature to set a max log file size before rotation, and a 
max number of log files to keep around. This way I can have a rough 
approximation of how much disk space will be dedicated to logging and it is 
bounded.

Original comment by toffale...@gmail.com on 10 Sep 2010 at 1:38

Attachments:

GoogleCodeExporter commented 9 years ago
    export GLOG_max_log_size=100
This environment variable will keep the maximum log size to 100MB.

    export GLOG_stop_logging_if_full_disk=1
This environment variable will stop logging if the disk is full. 

Original comment by slateef...@gmail.com on 10 Nov 2010 at 7:51

GoogleCodeExporter commented 9 years ago
Those environment variables are not the same as rolling logs with a max size.

Original comment by toffale...@gmail.com on 13 Dec 2010 at 8:38

GoogleCodeExporter commented 9 years ago
Any progress on this issue?
+1 for adding RotateLogFiles() API to be used in conjunction with SIGHUP, as 
proposed in #3.

Original comment by maehashi on 18 Mar 2014 at 6:18