This repository was archived by the owner on Aug 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
This repository was archived by the owner on Aug 31, 2020. It is now read-only.
Log file rotation not happening #14
Copy link
Copy link
Open
Description
Version/System Details
======================
GoLang version 1.0.3
OS: Issue on Windows 7 and Debian linux
log4go version 3.0.1
Issue Description
=================
I have a fairly simple app that needs only one log file and I have defined my
log4ggo configuration as follows:
<logging>
<filter enabled="false">
<tag>stdout</tag>
<type>console</type>
<!-- level is (:?FINEST|FINE|DEBUG|TRACE|INFO|WARNING|ERROR) -->
<level>DEBUG</level>
</filter>
<filter enabled="true">
<tag>AppLog</tag>
<type>file</type>
<level>DEBUG</level>
<property name="format">[%D %T] [%L] (%S) %M</property>
<property name="filename">app/log/main.log</property>
<property name="rotate">false</property> <!-- true enables log rotation, otherwise append -->
<property name="maxsize">5M</property> <!-- \d+[KMG]? Suffixes are in terms of 2**10 -->
<property name="maxlines">0K</property> <!-- \d+[KMG]? Suffixes are in terms of thousands -->
<property name="daily">false</property> <!-- Automatically rotates when a log message is written after midnight -->
</filter>
</logging>
This creates the log file, it creates only one file and does not generate new
files when the thresholds are met. You will see that I have rotate set to
false. If I set
<property name="rotate">true</property> <!-- true enables log rotation, otherwise append -->
then the application when running writes every log line to a new file.
Eventually it crashes as it has written so many log files it cannot generate a
new unique log number this happens after main.log.999
What I would like is to keep a set of say 10 log files that are max size 5MB;
in the same way the log4j works for Java.
Thanks for writing this library and making it available, on the whole it is an
excellent package, thanks for you r efforts on it.
Original issue reported on code.google.com by [email protected]
on 7 Mar 2013 at 10:11