Jump to content
We've recently updated our Privacy Statement, available here ×
  • Jasperserver rolling log configuration


    Jivan Phadtare
    • Version: v8.0 Product: JasperReports® Server

     

    In production environment many times log backups are not available to troubleshoot the issues. Logs are actually rolled over.

    The 'jasperserver.log' rollover log rotation configuration handled in "log4j2.properties" file.
    Location : ...webappsjasperserver-proWEB-INF

    Below section from "log4j2.properties" file contains the rolling configuration.

    ------------------

    # Rolling log file output...
    # jasperserver.root is used only by JasperServer Community Edition.
    # JasperServer Professional users should look for jasperserver-pro.root lower in this file.
    appender.fileout.type=RollingFile
    appender.fileout.name=fileout
    appender.fileout.fileName=${log4j:configParentLocation}/logs/jasperserver.log
    appender.fileout.filePattern=${log4j:configParentLocation}/logs/jasperserver.%i.log.gz
    appender.fileout.policies.type = Policies
    appender.fileout.policies.size.type = SizeBasedTriggeringPolicy
    appender.fileout.policies.size.size=1024KB
    appender.fileout.strategy.type = DefaultRolloverStrategy
    appender.fileout.strategy.max = 1
    appender.fileout.layout.type=PatternLayout
    # Valid date format specifiers for the conversionPattern include "ABSOLUTE", "DATE" and "ISO8601"
    appender.fileout.layout.pattern=%d{ISO8601} %5p %c{1},%t:%L - %m%ex%n
    appender.fileout.layout.charset=UTF-8

    ------------------ 

    In above configuration setting - When the log file reaches 1MB (property : appender.fileout.policies.size.size), a new log file is created, and the previous log file is compressed and kept. Only one backup log file is maintained (property : appender.fileout.strategy.max).

    /*
    appender.fileout.strategy.max=1: It limits the number of backup log files to 1, meaning only one previous log file is kept
    appender.fileout.policies.size.size=1024KB: This sets the maximum size for log files. When the primary log file (jasperserver.log) reaches 1024KB (1MB), it triggers log rotation.
    */

    These values can be changed to capture exact log file during performance issues.

     


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...