Search code examples
loggingweblogic

weblogic logback configuration for each web application


We have almost 10 different web application which is deployed in weblogic 12c. Each app uses one or two common java lib(custom domain common code). We would like to generate one log file for each web app. Does anyone know what is the best way to achieve this?

Or if someone has better idea, we are open for this.

All we need is log file for each app and should be rolling based on size and archive it without affecting performance.


Solution

  • As long as each application has a local logback.xml file, you will get separate log file for each application. Be sure to drop each application log into its own folder. We use something like this:

    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
    <fileNamePattern>ApplicationName/logFile.%d{yyyy-MM-dd}.log</fileNamePattern>
    <maxHistory>10</maxHistory>
    </rollingPolicy>