[Opensim-dev] About log files ...

Kyle Hamilton aerowolf at gmail.com
Thu Aug 21 08:34:10 UTC 2008


What you're looking at in that case is a "sparse file" -- there's a
whole lotta nil octets in it, if you use od or such to look at it.
However, the on-disk structure basically says "our first write was a
file position X, so everything before that is 0x00, so we don't have
to waste the space just storing zeroes".

In order for log rotation to work properly (without creating sparse
files) the logging process must close the file and reopen it.
Preferably it can do this every time it's called on to add something
to the log.

I don't know enough about log4net to know if there's any parameter to
FileAppender to allow it to close the file between log messages.

(Homer, the information on rolling file appenders is appreciated.
Many UNIX admins prefer to use their platform-native rolling
implementation, though, so they know exactly where to look in the case
of breakage.  I'd like to see if there's any way to do that?)

-Kyle H

On Wed, Aug 20, 2008 at 10:45 PM, Ursula MATOVA
<ursula.matova at klintcentral.net> wrote:
> Oupps sorry,
>
>> when a new event is logged,
>> the newly created OpenSim.log starts with it original size ( and all
>> supposed rotated informations ) ...
>
> ==> On the UNIX filesystem, the reported file size for OpenSim.log is
> the "original" one.
> But maybe it's a but ( on my Ubuntu ), because the contents is ok, and
> when you check the size of the logfile with "du -sh OpenSim.log", it
> reports the right information.
>
> Sorry for the noise.
>
> :)
>
> Le 21 août 08 à 07:40, Ursula MATOVA a écrit :
>
>> Well, just played with log4net :
>>
>> changing log level in OpenSim.exe.config from INFO to WARN do the
>> job ;)
>>
>> About log rotation :
>>
>> ==> /etc/logrotate.d/opensim
>>
>> # rotate the dekiwiki api log daily
>> /path/to/OpenSim.log {
>>         daily
>>         rotate 7
>>         missingok
>>         copytruncate
>>         compress
>> }
>>
>> To test LogRotation :
>>
>> logrotate -f /etc/logrotate.d/opensim
>>
>> So, seems to work, the log rotates :)
>>
>> BUT
>>
>> when a new event is logged,
>> the newly created OpenSim.log starts with it original size ( and all
>> supposed rotated informations ) ...
>>
>> Regards,
>>
>> Ursula.
>>
>> Le 21 août 08 à 07:18, Ursula MATOVA a écrit :
>>
>>> Thanks a lot Justin,
>>>
>>> the page you wrote is very helpfull :)
>>>
>>> Thanks again,
>>> Regards,
>>>
>>> Ursula.
>>>
>>> Le 21 août 08 à 00:41, Justin Clark-Casey a écrit :
>>>
>>>> Not at all.  However, changing the log file levels (before startup)
>>>> can
>>>> already be done by editing OpenSim.exe.config (we use a package
>>>> called
>>>> log4net).  I wrote up a scratch page on logging and how to go about
>>>> doing this at
>>>>
>>>> http://opensimulator.org/wiki/Logging#Changing_logging_levels_before_startup
>>>>
>>>> I think that log4net can also handle log rotation.  It would be nice
>>>> if
>>>> someone could put some commented sections in files such as
>>>> OpenSim.exe.config to show how this could be done.
>>>>
>>>> --
>>>> justincc
>>>> Justin Clark-Casey
>>>> http://justincc.wordpress.com
>>>> _______________________________________________
>>>> Opensim-dev mailing list
>>>> Opensim-dev at lists.berlios.de
>>>> https://lists.berlios.de/mailman/listinfo/opensim-dev
>>>>
>>>
>>> _______________________________________________
>>> Opensim-dev mailing list
>>> Opensim-dev at lists.berlios.de
>>> https://lists.berlios.de/mailman/listinfo/opensim-dev
>>>
>>
>> _______________________________________________
>> Opensim-dev mailing list
>> Opensim-dev at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/opensim-dev
>>
>
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>


More information about the Opensim-dev mailing list