This can be achieved by defining multiple log files using single log4j configuration, and configure BE logging with the customized log4j configuration.
1. Disable the default logging mode and use the log4j mode for logging
See the below link for how to overriding the Default Logging Mode:
https://docs.tibco.com/pub/businessevents-standard/5.4.1/doc/html/GUID-B5B063CB-F2AF-4A31-B4F3-602C4C476BA1.html2. Create one's own log4j configuration with multiple Log files
<appender name="normal" class="org.apache.log4j.RollingFileAppender">
<param name="file" value="D:/WorkingSpaces/BE550/TEMP_64/normal.log"/>
<param name="MaxFileSize" value="100MB"/>
<param name="MaxBackupIndex" value="10"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy MMM dd HH:mm:ss.SSS 'GMT'XXX} %p [%c{3}] - %m%n"/>
</layout>
</appender>
<appender name="Error" class="org.apache.log4j.RollingFileAppender">
<param name="file" value="D:/WorkingSpaces/BE550/TEMP_64/Error.log"/>
<param name="MaxFileSize" value="100MB"/>
<param name="MaxBackupIndex" value="10"/>
<param name="threshold" value="error"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy MMM dd HH:mm:ss.SSS 'GMT'XXX} %p [%c{3}] - %m%n"/>
</layout>
</appender>
3. Refer to appender in root logger
<root>
<priority value ="info" />
<appender-ref ref="normal" />
<appender-ref ref="Error"/>
</root>
4. Add the following property in the be-engine.tra file to use this custom log4j configuration
java.property.log4j.configuration=[custom_log4j_path]
Note: if the custom log4j file is not in the classpath but located elsewhere on your device, use the following in be-engine.tra file:
java.property.log4j.configuration=file:[custom_log4j_file_path]
See attached log4j.xml for your reference. With this custom log4j, we defined the following appenders:
- console will direct logs to console
- normal the normal BE log(similar to log files generated with default logging mode) which will be written to normal.log
- Warn logs at Warn level and above will be written to Warn.log
- Error logs at Error level and above will be written to Error.log
Also see normal.log, Warn.log, Error.log which were generated by one BE engine from the attached sample_logs.zip for your reference.