I've been using Go for a while now and really like it. I was also
pleasantly surprised to find a log4go - a library very similar to log4j
which I am very familiar with.
I have a fairly simple app that needs only one log file and I have defined
my configuration as follows:
<!-- level is (:?FINEST|FINE|DEBUG|TRACE|INFO|WARNING|ERROR) -->
<property name="format">[%D %T] [%L] (%S) %M</property>
<property name="rotate">false</property> <!-- true enables log
rotation, otherwise append -->
<property name="maxsize">10M</property> <!-- \d+[KMG]? Suffixes are in
terms of 2**10 -->
<property name="maxlines">1K</property> <!-- \d+[KMG]? Suffixes are in
terms of thousands -->
<property name="daily">false</property> <!-- Automatically rotates when
a log message is written after midnight -->
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.
Does anyone know what it is have got wrong with this or what changes I need
Thanks in advance
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.