Programmatically create a new log4j appender within Wowza

You can specify a specific log file per application dynamically by creating the relevant appender as-needed.

Logger logger = Logger.getLogger(appName);
String pattern = “%d %m%n”;
PatternLayout layout = new PatternLayout(pattern);
appender = new DailyRollingFileAppender();
appender.setAppend(true);
appender.setLayout(layout);
appender.setFile(“/path/to/”+appName+”-logfile.log”);
appender.activateOptions();
logger.addAppender(appender);
logger.setLevel((Level) Level.INFO);


Comments are closed.