|
From: Katharina W. <wol...@fh...> - 2014-10-14 12:11:59
|
Hi again!
After some tinkering with the logrotate-debug- and cron.daily-setup-options I've
finally managed to test out a working solution to my problem based on Brandon's tip.
I needed to replace the line
create 644 svnuser svn
with
copytruncate
thus keeping solr happily writing into one and the same (!!!) logfile and
compressing and filing away a copy.
Thanks again for the marvelously fast help of the list!
Kate
Am 14.10.2014 um 07:11 schrieb Ere Maijala:
> True, SLF4J doesn't do all the fancy stuff logrotate does. You could of
> course let logrotate do the advanced stuff on the files SLF4J has
> already rotated, but maybe Brandon's approach is easier. :)
>
> --Ere
>
> 13.10.2014 16.54, Katharina Wolkwitz kirjoitti:
>> Hi Ere,
>>
>> if I understand your suggestion correctly, that would only handle one line of
>> the logrotate-file:
>>
>> rotate 99
>>
>> which tells logrotate to keep up to 99 compressed files before getting rid of
>> the oldest ones, but all the other options that logrotate also knows how to do
>> (filesize, compressing etc.) - wouldn't I need to tell SLF4J those too?
>>
>> At the moment I'm wondering, if it weren't the easiest way to simply just
>> restart vufind after putting away the logfile???
>> And in order to lessen the frequency of that occurrance to push up the size when
>> the file will be compressed. size=+32M instead of size=+4096k
>>
>> Any comments to this idea?
>>
>> Kate
>>
>> Am 13.10.2014 um 14:36 schrieb Ere Maijala:
>>> I'd suggest configuring Solr to rotate the logs, so you won't need
>>> logrotate at all. Solr can use SLF4J (up to version 4.2.1) or a
>>> selectable logging facility (from 4.3), and you can configure it to
>>> rotate logs. Without any configuration it seems logging will go to
>>> standard output, which means that in VuFind everything ends up in
>>> wherever JETTY_CONSOLE points to, but setting up SLF4J lets Solr logging
>>> output to go somewhere else.
>>>
>>> I don't usually run VuFind's default Solr, but it seems to have a sample
>>> logging.properties file in solr/jetty/etc. You could modify (a copy of)
>>> it and add a line like this:
>>>
>>> java.util.logging.FileHandler.count = 10
>>>
>>> This means rotation keeps 10 files. Note that the default log directory
>>> in logging.properties is ./logs, so create it or change
>>> java.util.logging.FileHandler.pattern as necessary. Then specify the
>>> logging configuration when starting Solr like this (or modify your
>>> startup script accordingly):
>>>
>>> JAVA_OPTIONS="-Djava.util.logging.config.file=solr/jetty/etc/logging.properties"
>>> ./vufind.sh start
>>>
>>> Hope this helps, but if I was unclear, feel free to ask for clarification!
>>>
>>> --Ere
>>>
>>> 13.10.2014 14.09, Katharina Wolkwitz kirjoitti:
>>>> Hello everybody!
>>>>
>>>> After setting up solr to write it's logfiles to /var/log/solr/solr.log I then
>>>> set up logrotate in order to minimize the needed server space.
>>>>
>>>> Now I've encountered problems when I wanted to analyze the older logfiles and
>>>> found that all the files seemed to end when the logrotate-process starts and a
>>>> new file only begins when the server or vufind is next rebootet. :-(
>>>>
>>>> Here is the /etc/logrotate.d/solr-file:
>>>>
>>>> /var/log/solr/solr.log {
>>>> compress
>>>> dateext
>>>> maxage 365
>>>> rotate 99
>>>> size=+4096k
>>>> daily
>>>> notifempty
>>>> missingok
>>>> create 644 svnuser svn
>>>> }
>>>>
>>>> I guess the problem is that solr needs to be told explicitly to start a new
>>>> logfile, but how do I do that? I googled but didn't really find a satisfying
>>>> answer to that problem...
>>>>
>>>> Any tipps appreciated.
>>>> Kate
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>>>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>>>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>>>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>>> http://p.sf.net/sfu/Zoho
>>>> _______________________________________________
>>>> Vufind-tech mailing list
>>>> Vuf...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/vufind-tech
>>>>
>>>
>>>
>>
>>
>
>
--
Mit freundlichen Grüßen
Katharina Wolkwitz
Fachhochschule Südwestfalen
Hochschulbibliothek
Haldener Straße 182
58095 Hagen
Tel.: 02331/9330-607
FAX: 02331/9330-608
|