logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Sedano <antonio.sed...@neat-group.com>
Subject Is it possible to allocate the log size?
Date Thu, 15 Oct 2015 09:06:30 GMT
Hello everyone.

I would like to know if it is possible to allocate previously the size of the log file.

I have different window services working with log4net, we did not have any problem during
two years, but we detected the machine has the disk very fragment, and the cpu arrived to
100%, meanwhile the physical memory had same values. This increment of CPU has gradually been
going up in the time.

After a defragmentation of the disk, we decided to change the path where the log4net files
were writing and we put them in a remote path in other machine, with enough space but not
too much. After few we weeks we checked this new "log file machine" has the disk very fragment.

The log4net appender we use:
<appender name="FILE" type="log4net.Appender.RollingFileAppender">
      <file value="CN.log"/>
      <appendToFile value="true"/>
      <rollingStyle value="Size"/>
      <maxSizeRollBackups value="136" />
      <maximumFileSize  value="15MB"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date{yyyy-MM-dd;HH:mm:ss.ffff};%-5level;%C{1}:%L;%message%newline"/>

One workaround  to avoid to fragment the disk is to allocate the full size of the 136 files
of 15 MB (around 2GB)previously to start writing. Is there any way to do this with log4net?

We have been searching but we have not found anything about this. Other pro

Other proposals are welcome.

Thanks in advance.


Antonio Sedano Maestre

Programmer Analyst
Calle del Espino, 14 - Urb. Monteprincipe - 28668 Boadilla del Monte - Madrid
Tlf. 902 365 748    Fax 91 535 08 89
antonio.sedano@neat-group.com<mailto:antonio.sedano@neat-group.com>    www.neat-group.com<http://www.neat-group.com/>

En virtud de lo dispuesto en la Ley Orgánica 15/1999 de Protección de Datos de Carácter
Personal, le informamos de que sus datos de carácter personal, recogidos de fuentes accesibles
al público o datos que usted nos ha facilitado previamente, se encuentran recogidos en un
fichero propiedad de GRUPO NEAT, S.L., con la finalidad de gestionar la relación negocial
que nos vincula e informarle de nuestros productos y servicios. Si desea ejercitar los derechos
de acceso, rectificación, cancelación y oposición puede dirigirse por escrito a: GRUPO
NEAT, S.L., a la atención del Responsable de Protección de Datos, Calle del Espino nº 14,
28668, BOADILLA DEL MONTE, MADRID, o al correo electrónico QID@NEAT-GROUP.COM<mailto:QID@NEAT-GROUP.COM>

View raw message