You can use the karaf.bootstrap.log in etc/config.properties to change the file that the karaf Main class will use when bootstrapping karaf (that's before the OSGi framework and bundles are launched). This way, those log statements will not alter the rolling files.
Guillaume 2016-06-17 11:22 GMT+02:00 Althaus, Volker <[email protected]>: > Hi Achim, > > my scenario works fine for all other rolling loggers, like specific bundle > loggers. > > > > The exception is the karaf.log, in my opinion because the early > Karaf/Pax-logging startup sequence partially bypasses the defined log > appender. > > The typical startup log: > > > > 01: Jun 17, 2016 8:29:40 AM org.apache.karaf.main.Main launch > > 02: INFORMATION: Installing and starting initial bundles > > 03: Jun 17, 2016 8:29:41 AM org.apache.karaf.main.Main launch > > 04: INFORMATION: All initial bundles installed and set to start > > 05: Jun 17, 2016 8:29:41 AM org.apache.karaf.main.lock.SimpleFileLock lock > > 06: INFORMATION: Trying to lock D:\apache-karaf-4.0.4\lock > > 07: Jun 17, 2016 8:29:41 AM org.apache.karaf.main.lock.SimpleFileLock lock > > 08: INFORMATION: Lock acquired > > 09: Jun 17, 2016 8:29:41 AM org.apache.karaf.main.Main$KarafLockCallback > lockAquired > > 10: INFORMATION: Lock acquired. Setting startlevel to 100 > > 11: 2016-06-17 08:29:42,241 | INFO | FelixStartLevel | > fileinstall | 8 - org.apache.felix.fileinstall - 3.5.0 > | Creating configuration from org.apache.karaf.shell.cfg > > 12: 2016-06-17 08:29:42,261 | INFO | FelixStartLevel | > fileinstall | 8 - org.apache.felix.fileinstall - 3.5.0 > | Creating configuration from jmx.acl.org.apache.karaf.security.jmx.cfg > > 13: … > > > > I interpret this log as follows: > > The first ten lines seem not to be handled by the DailyRollingFileAppender > (even though the logging system knows which file to use, and this is also > configured in the appender), but the log file is touched anyway. > > Later then (line 11ff) the DRFA is completely initialized, checks the > modify date for the first time and skips the rollover. > > > > For administrators this is a problem because they eventually have fixed > times where background services like Karaf may do their work. So they need > to restart Karaf from time to time. > > Also the logs can get very large after a day and they need the rollover. > > Of course they could move the old log file before every restart, but then > they have to care about the naming by themselves. I would prefer to find a > nicer solution. > > > > > > Regards, > > Volker > > > > > > *Von:* Achim Nierbeck [mailto:[email protected] > <[email protected]>] > *Gesendet:* Donnerstag, 16. Juni 2016 23:47 > *An:* [email protected] > *Betreff:* Re: karaf.log does not rollover after restart > (DailyRollingFileAppender ) > > > > Hi Volker, > > > > Karaf itself doesn't do the logging it's the pax-logging module. > > That said, Pax-Logging only re-uses log4j, AFAICR log4j (v1) never did a > roll-over in your scenario. > > CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, > Fax: +49 711 7825-4000, Internet: www.cenit.com > Geschaeftsstellen: Berlin, Frankfurt, Hamburg, Hannover, Muenchen, > Oelsnitz, Ratingen, Saarbruecken > Vorstandsmitglieder: Kurt Bengel, Matthias Schmidt > Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des Aufsichtsrats), > Hubert Leypoldt, Andreas Karrer > Bankverbindungen: > Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 > 1040 00 SWIFT-CODE : DEUTDESS, > Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 > 0155 00 SWIFT-Code : COBADEFF600, > Registergericht: Amtsgericht Stuttgart > Handelsregister: HRB Nr. 19117 > Umsatzsteuer: ID-Nr. DE 147 862 777 > -- ------------------------ Guillaume Nodet ------------------------ Red Hat, Open Source Integration Email: [email protected] Web: http://fusesource.com Blog: http://gnodet.blogspot.com/
