Missing xvhost of ServerListenerStreamPublisher in ACCESS LOG

Hi,

I setup my VHost with StreamPublisher plugin to play a playlist. To get last item played I parse access log, getting lines like “ServerListenerStreamPublisher PlayList Item Start: mp4:%.mp4” adding where condition "xvhost = ‘VHost_1’ ". But on many VHost, the Logger doesn’t write which VHost played that Item. Why?

Maurizio

Hello Maurizio,

It sounds like you are provisioning separate VHosts, so have you also configured a specific logging configuration for these VHosts in the log4j.properties file?

Regards

Jason Hatchett

Hello Maurizio,

In the default log4j.properties file there are two sections that in the default are commented out, one starts with this comment:

APPLICATION LEVEL LOGGING CONFIG - START

the other starts with this comment:

VHOST LEVEL LOGGING CONFIG - START

I woudl suggest trying to utilize these logging levels in your workflow and this How-To article can help you enable those logging elements:

https://www.wowza.com/docs/how-to-configure-vhost-and-application-context-logging

If one of these options does not clear up the issue you are reporting please let me know.

Regards,

Jason Hatchett

Hello Maurizio,

It sounds like you are provisioning separate VHosts, so have you also configured a specific logging configuration for these VHosts in the log4j.properties file?

Regards

Jason Hatchett

Hi Jason,

apologizes for being late. My wowza system write access_log and play_stop_log to MYSQL database. My log4j configuration is the following.

log4j.rootCategory=INFO, stdout, serverAccess, serverError, SQ, SQ_PLAY
# Console appender
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=com.wowza.wms.logging.ECLFPatternLayout
log4j.appender.stdout.layout.Fields=x-severity,x-category,x-event,x-ctx,x-comment
log4j.appender.stdout.layout.OutputHeader=false
log4j.appender.stdout.layout.QuoteFields=false
log4j.appender.stdout.layout.Delimiter=space
# Access appender
log4j.appender.serverAccess=org.apache.log4j.DailyRollingFileAppender
log4j.appender.serverAccess.encoding=UTF-8
log4j.appender.serverAccess.DatePattern='.'yyyy-MM-dd
log4j.appender.serverAccess.File=${com.wowza.wms.ConfigHome}/logs/wowzastreamingengine_access.log
log4j.appender.serverAccess.layout=com.wowza.wms.logging.ECLFPatternLayout
#log4j.appender.serverAccess.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
log4j.appender.serverAccess.layout.Fields=date,time,tz,x-event,x-category,x-severity,x-status,x-ctx,x-comment,x-vhost,x-app,x-appinst,x-duration,s-ip,s-port,s-uri,c-ip,c-proto,c-referrer,c-user-agent,c-client-id,cs-bytes,sc-bytes,x-stream-id,x-spos,cs-stream-bytes,sc-stream-bytes,x-sname,x-sname-query,x-file-name,x-file-ext,x-file-size,x-file-length,x-suri,x-suri-stem,x-suri-query,cs-uri-stem,cs-uri-query
log4j.appender.serverAccess.layout.OutputHeader=true
log4j.appender.serverAccess.layout.QuoteFields=false
log4j.appender.serverAccess.layout.Delimeter=tab
# Error appender
log4j.appender.serverError=org.apache.log4j.DailyRollingFileAppender
log4j.appender.serverError.encoding=UTF-8
log4j.appender.serverError.DatePattern='.'yyyy-MM-dd
log4j.appender.serverError.File=${com.wowza.wms.ConfigHome}/logs/wowzastreamingengine_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
log4j.appender.serverError.layout.OutputHeader=true
log4j.appender.serverError.layout.QuoteFields=false
log4j.appender.serverError.layout.Delimeter=tab
log4j.appender.serverError.Threshold=WARN
log4j.appender.serverStats=org.apache.log4j.DailyRollingFileAppender
log4j.appender.serverStats.encoding=UTF-8
log4j.appender.serverStats.DatePattern='.'yyyy-MM-dd
log4j.appender.serverStats.File=${com.wowza.wms.ConfigHome}/logs/wowzastreamingengine_stats.log
log4j.appender.serverStats.layout=com.wowza.wms.logging.ECLFPatternLayout
log4j.appender.serverStats.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
log4j.appender.serverStats.layout.OutputHeader=true
log4j.appender.serverStats.layout.QuoteFields=false
log4j.appender.serverStats.layout.Delimeter=tab
log4j.appender.serverStats.layout.CategoryInclude=session,stream
log4j.appender.serverStats.layout.EventExclude=comment
# Write to database
log4j.appender.SQ=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.SQ.Driver=com.mysql.jdbc.Driver
log4j.appender.SQ.URL=jdbc:mysql://localhost:3306/<dbname>
log4j.appender.SQ.user=<dbuser>
log4j.appender.SQ.password=<dbpass>
log4j.appender.SQ.layout=com.wowza.wms.logging.ECLFPatternLayout
log4j.appender.SQ.layout.OutputHeader=false
log4j.appender.SQ.layout.EventInclude=play,stop
log4j.appender.SQ.sql=INSERT INTO play_stop_log (date, time, tz, xevent, xcategory, xseverity,xstatus,xctx,xcomment,xvhost,xapp,xappinst,xduration,sip,sport,suri,cip,cproto,creferrer,cuseragent,cclientid,csbytes,scbytes,xstreamid, xspos,csstreambytes,scstreambytes,xsname,xsnamequery,xfilename,xfileext,xfilesize,xfilelength,xsuri,xsuristem,xsuriquery,csuristem,csuriquery) VALUES ('%X{date}', '%X{time}', '%X{tz}', '%X{x-event}', '%X{x-category}', '%X{x-severity}', '%X{x-status}', '%X{x-ctx}', '%X{x-comment}', '%X{x-vhost}', '%X{x-app}', '%X{x-appinst}', '%X{x-duration}', '%X{s-ip}', '%X{sport}', '%X{s-uri}', '%X{c-ip}', '%X{c-proto}', '%X{c-referrer}', '%X{c-user-agent}', '%X{c-client-id}', '%X{cs-bytes}', '%X{scbytes}', '%X{x-stream-id}', '%X{x-spos}','%X{cs-stream-bytes}', '%X{sc-stream-bytes}', '%X{x-sname}', '%X{x-sname-query}', '%X{x-file-name}', '%X{x-file-ext}', '%X{x-file-size}', '%X{x-file-length}','%X{x-suri}','%X{x-suri-stem}', '%X{x-suri-query}', '%X{c-suri-stem}', '%X{c-suri-query}');
log4j.appender.SQ_PLAY=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.SQ_PLAY.Driver=com.mysql.jdbc.Driver
log4j.appender.SQ_PLAY.URL=jdbc:mysql://localhost:3306/<dbname>
log4j.appender.SQ_PLAY.user=<dbuser>
log4j.appender.SQ_PLAY.password=<dbpass>
log4j.appender.SQ_PLAY.layout=com.wowza.wms.logging.ECLFPatternLayout
log4j.appender.SQ_PLAY.layout.OutputHeader=false
log4j.appender.SQ_PLAY.layout.EventInclude=comment
log4j.appender.SQ_PLAY.sql=INSERT INTO accesslog (date, time, tz, xevent, xcategory, xseverity,xstatus,xctx,xcomment,xvhost,xapp,xappinst,xduration,sip,sport,suri,cip,cproto,creferrer,cuseragent,cclientid,csbytes,scbytes,xstreamid, xspos,csstreambytes,scstreambytes,xsname,xsnamequery,xfilename,xfileext,xfilesize,xfilelength,xsuri,xsuristem,xsuriquery,csuristem,csuriquery) VALUES ('%X{date}', '%X{time}', '%X{tz}', '%X{x-event}', '%X{x-category}', '%X{x-severity}', '%X{x-status}', '%X{x-ctx}', '%X{x-comment}', '%X{x-vhost}', '%X{x-app}', '%X{x-appinst}', '%X{x-duration}', '%X{s-ip}', '%X{sport}', '%X{s-uri}', '%X{c-ip}', '%X{c-proto}', '%X{c-referrer}', '%X{c-user-agent}', '%X{c-client-id}', '%X{cs-bytes}', '%X{scbytes}', '%X{x-stream-id}', '%X{x-spos}','%X{cs-stream-bytes}', '%X{sc-stream-bytes}', '%X{x-sname}', '%X{x-sname-query}', '%X{x-file-name}', '%X{x-file-ext}', '%X{x-file-size}', '%X{x-file-length}','%X{x-suri}','%X{x-suri-stem}', '%X{x-suri-query}', '%X{c-suri-stem}', '%X{c-suri-query}');

There are many commentd lines about “VHOST LEVEL LOGGING CONFIG” but why many VHost write its own name on DB and many other not?

Thanks,

Maurizio