Wowza Community

Wowza logging via rsyslog?

Has anyone had any success getting Wowza (therefor log4j) to send messages to a remote logging server? We generally run multiple worker instances in a load balanced configuration, killing off unneeded workers when load drops off, and having to move their log files to a central point before terminating gets to be quite a chore. I’m thinking it would be a lot more convenient to have all workers log to a central rsyslogd machine. Unfortunately there doesn’t seem to be a lot of information available on doing this.

Has anybody implemented this solution before? If so, how did you go about making it work?

The /conf/log4j.properties file has a commented out UDP appender. I don’t have any experience with it, however

Richard

Very cool. Thank you for this great howto write-up. I will try it out.

Richard

That would work, but since we bill customers based upon our log contents I really was looking for a solution that would use TCP.

The solution I finally developed was to use rsyslog. I designated one of my lightly-loaded EC2 instances to be by rsyslog server, and in it’s rsyslog.conf I included:

$ModLoad imtcp # loads the tcp module

$InputTCPServerRun 514 # defines what port to listen on

$EscapeControlCharactersOnReceive off # Prevents rsyslog from turning tab into #011

$template WowzaFormat,"%TIMESTAMP% %fromhost-ip% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" # Defines log line format

$ActionFileDefaultTemplate WowzaFormat

local1.* /var/log/wowza.log # Specifies that all messages for facility “local1” get written to wowza log file

Then on my worker instances I set up the rsyslog.conf with:

$InputFileName /usr/local/WowzaMediaServer/logs/wowzamediaserver_access.log

$InputFileTag wowzaAccess:

$InputFileStateFile statefile_access

#$InputFileSeverity info

$InputFileFacility local1

$InputRunFileMonitor

local1.* @@

#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

$template WowzaFormat,"%TIMESTAMP% %fromhost-ip% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"

$ActionFileDefaultTemplate WowzaFormat

This setup has been working well for us for a couple of weeks now. I describe the setup process in a little more detail in my blog ( http://www.streemit.net/2012/04/20/remote-logging-for-wowza/) but the basic info included here should provide enough to get you started if you find that you need to centralize your Wowza logs too.

You could try NXLog instead of rsyslog, here’s a quick comparison about why:

https://nxlog.co/products/nxlog-community-edition/why