OK I am now one step further by omitting the part with the “WowzaMediaServerPro-Service.conf”.
My log file is now created and I assume that the custom fields are being generated.
The problem is now that they are always empty (-).
They don’t seem to get evaluated at all.
Here is my class definition:
public class NewLog implements ILogNotify {
public void onLog(Level level, String comment, IMediaStream stream, String category,
String event, int status, String context) {
long systime = System.nanoTime();
WMSLoggerFactory.putGlobalLogValue("CustomField1", systime);
WMSLoggerFactory.putGlobalLogValue("CustomField2", systime + " LOGTEST");
}
}
Here is part of my log4j.properties file:
log4j.rootCategory=INFO, stdout, serverAccess, serverError, newinfo
..
..
# Error appender
log4j.appender.serverError=org.apache.log4j.DailyRollingFileAppender
log4j.appender.serverError.DatePattern='.'yyyy-MM-dd
log4j.appender.serverError.File=${com.wowza.wms.ConfigHome}/logs/wowzamediaserver_error.log
log4j.appender.serverError.layout=com.wowza.wms.logging.ECLFPatternLayout
log4j.appender.serverError.layout.Fields=x-severity,x-category,x-event;date,time,c-client-id,c-ip,c-port,cs-bytes,sc-bytes,x-duration,x-sname,x-stream-id,x-spos,sc-stream-bytes,cs-stream-bytes,x-file-size,x-file-length,x-ctx,x-comment,CustomField1,CustomField2
log4j.appender.serverError.layout.OutputHeader=true
log4j.appender.serverError.layout.QuoteFields=false
log4j.appender.serverError.layout.Delimeter=tab
log4j.appender.serverError.Threshold=WARN
..
################
# Custom Log File
log4j.appender.newinfo=org.apache.log4j.DailyRollingFileAppender
log4j.appender.newinfo.DatePattern='.'yyyy-MM-dd
log4j.appender.newinfo.File=${com.wowza.wms.ConfigHome}/logs/wowzamediaserver_newinfo.log
log4j.appender.newinfo.layout=com.wowza.wms.logging.ECLFPatternLayout
log4j.appender.newinfo.layout.Fields=date,time,tz,x-event,x-category,x-severity,x-status,CustomField1,CustomField2
log4j.appender.newinfo.layout.OutputHeader=true
log4j.appender.newinfo.layout.QuoteFields=false
log4j.appender.newinfo.layout.Delimeter=tab
log4j.appender.newinfo.Threshold=WARN
################
As you can see I have added the Custom fields in the error appender in order to check if I am getting anything there.
My output for the error appender is :
#Version: 1.0
#Start-Date: 2013-12-18 15:52:01 EET
#Software: Wowza Media Server 3.6.3 build8031
#Date: 2013-12-18
#Fields: x-severity x-category x-event date time c-client-id c-ip c-port cs-bytes sc-bytes x-duration x-sname x-stream-id x-spos sc-stream-bytes cs-stream-bytes x-file-size x-file-length x-ctx x-comment CustomField1 CustomField2
ERROR server comment 2013-12-18 15:52:01 - - - - - 0.164 - - - - - - - - ServerUtils.loadServerListener: Error creating <ServerListener> (com.wmspanel.WmsPanelAgent): java.lang.ClassNotFoundException: com.wmspanel.WmsPanelAgent - -
WARN server comment 2013-12-18 15:52:06 - - - - - 5.205 - - - - - - - - loadModFunctions[edge/_definst_]: Module class not found or could not be loaded. Check [install-dir]/conf/edge/Application.xml to be sure all Modules/Module/Class paths are correct: name:Wmsauth class:com.wmspanel.Wmsauth - -
WARN server comment 2013-12-18 15:52:18 - - - - - 17.625 - - - - - - - - LiveMediaStreamReceiver.doWatchdog: streamTimeout[live/_definst_/teststream]: Resetting connection: [removed ip]:1935/live/_definst_/teststream - -
WARN server comment 2013-12-18 15:52:31 - - - - - 30.626 - - - - - - - - LiveMediaStreamReceiver.doWatchdog: streamTimeout[live/_definst_/teststream]: Resetting connection: [removed ip]:1935/live/_definst_/teststream - -
and for the custom appender:
#Version: 1.0
#Start-Date: 2013-12-18 15:52:01 EET
#Software: Wowza Media Server 3.6.3 build8031
#Date: 2013-12-18
#Fields: date time tz x-event x-category x-severity x-status CustomField1 CustomField2
2013-12-18 15:52:01 EET comment server ERROR 500 - -
2013-12-18 15:52:06 EET comment server WARN 200 - -
2013-12-18 15:52:18 EET comment server WARN 200 - -
2013-12-18 15:52:31 EET comment server WARN 200 - -
2013-12-18 15:52:44 EET comment server WARN 200 - -
2013-12-18 15:52:56 EET comment server WARN 200 - -
2013-12-18 15:53:09 EET comment server WARN 200 - -
2013-12-18 15:53:21 EET comment server WARN 200 - -
Is there anything else I should do in order to have those fields evaluated?