Task #9576
closedprovision the smartgear logback configuration starting from a template
100%
Description
The in place xml editing is not reliable, and it's impossible to include or exclude chunks of configuration settings.
Also, move the log files under tomcat/logs where they really belong.
Related issues
Updated by Andrea Dell'Amico over 7 years ago
Also, add the following configuration on the dataminers (the log path will change):
<appender name="ANALYSIS" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>/home/gcube/SmartGears/analysis.log</file> <append>true</append> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}: %msg%n </pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>/home/gcube/SmartGears/analysis.%d{yyyy-MM-dd}.log </fileNamePattern> <maxHistory>30</maxHistory> </rollingPolicy> </appender> <logger name="org.gcube.dataanalysis" level="DEBUG"> <appender-ref ref="ANALYSIS" /> </logger>
Updated by Andrea Dell'Amico over 7 years ago
Another parameter that can be configured is maxHistory
: 30 days is usually too much.
Updated by Andrea Dell'Amico over 7 years ago
Last: if a size based rolling appender can be configured, this would be very helpful to keep the total log size under control.
Updated by Andrea Dell'Amico over 7 years ago
Since logback 1.1.7 there's an appender called SizeAndTimeBasedRollingPolicy
that does exactly what I'm asking. A reference: https://logback.qos.ch/manual/appenders.html#SizeAndTimeBasedRollingPolicy
Updated by Andrea Dell'Amico over 7 years ago
- Status changed from New to In Progress
Updated by Andrea Dell'Amico over 7 years ago
- % Done changed from 0 to 80
I have a prototype that uses the new rolling policy and also sets a global cap.
The log files will be moved into tomcat/logs too.
Updated by Andrea Dell'Amico over 7 years ago
@lucio.lelii@isti.cnr.it smartgear comes with logback 1.0.13 and it's too old to support the new rolling appender. We should upgrade to at least 1.1.7
Updated by Andrea Dell'Amico over 7 years ago
- Status changed from In Progress to Feedback
- % Done changed from 80 to 100
The new logback configuration has been installed on dataminer1-pre.d4science.org. @roberto.cirillo@isti.cnr.it @lucio.lelii@isti.cnr.it @gianpaolo.coro@isti.cnr.it please review it.
The SizeAndTimeBasedRollingPolicy
will be enabled when a newer logback version will be available.
Updated by Lucio Lelii over 7 years ago
- Status changed from Feedback to In Progress
- Assignee changed from _InfraScience Systems Engineer to Lucio Lelii
- % Done changed from 100 to 80
I have tested the new logback version (1.1.11) that support SizeAndTimeBasedRollingPolicy.
I'm going to update the version on the smartgears distribution and release it in 4.7.
The appender configuration is not correct for this new version, you have to add the %i suffix to the fileNamePattern:
<fileNamePattern>/home/gcube/SmartGears/analysis.%d{yyyy-MM-dd}.%i.log
Updated by Andrea Dell'Amico over 7 years ago
Lucio Lelii wrote:
The appender configuration is not correct for this new version, you have to add the %i suffix to the fileNamePattern:
<fileNamePattern>/home/gcube/SmartGears/analysis.%d{yyyy-MM-dd}.%i.log
Done.
Updated by Andrea Dell'Amico over 7 years ago
- Status changed from In Progress to Closed
- Assignee changed from Lucio Lelii to Andrea Dell'Amico
- % Done changed from 80 to 100
Updated by Andrea Dell'Amico over 7 years ago
- Related to Task #9942: Change the way to generate the logback.xml in smartgears container added