Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Adding a custom log file and custom log fields.

  1. #1
    Join Date
    Dec 2013
    Posts
    8

    Question Adding a custom log file and custom log fields.

    Hi,

    I am trying to create a custom logfile and custom log fields for logging.
    I am using the API's guide/example ( WowzaMediaServer_ServerSideAPI.pdf ) on page 687.

    It states that after creating a class with custom Global Log Values I should edit the :
    [install-dir]/bin/WowzaMediaServerPro-Service.conf
    and add some Java Additional Parameters.

    If on Windows, also edit
    [install-dir]/bin/WowzaMediaServerPro-Service.conf
    and add
    wrapper.java.additional.[n]=-Dcom.wowza.wms.logging.LogNotify=[full-path-to-your-ILogNotify-class]
    to the Java Additional Parameters section where [n] is the next number in the list of active parameters.
    My problem is that i do not have this file.
    I have Windows 7, Wowza Media Server 3.6.3 and I am using the startup/shutdown scripts to start and stop the server.

    Should I create this file and put:
    wrapper.java.additional.[1]=-
    Dcom.wowza.wms.logging.LogNotify=[full-path-to-your-ILogNotify-class]
    ???????????

    Any help will be greatly appreciated.

  2. #2

    Default

    I think you are on the right track here. I suggest skipping the step of editing "WowzaMediaServerPro-Service.conf" and try it out. Some of the Wowza documentation may be in need of updating.

    Salvadore

  3. #3
    Join Date
    Dec 2013
    Posts
    8

    Default

    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?

  4. #4

    Default

    Hi,

    Are you running Wowza in the IDE? If so, you will need to edit your project run or debug configuration and add the the following to the VM Arguments on the Arguments tab.

    -Dcom.wowza.wms.logging.LogNotify=[your.custom.Class]
    The IDE does not use the files in the [install-dir]/bin folder when running Wowza.

    Roger.

  5. #5
    Join Date
    Dec 2013
    Posts
    8

    Default

    Quote Originally Posted by roger_l View Post
    Hi,

    Are you running Wowza in the IDE? If so, you will need to edit your project run or debug configuration and add the the following to the VM Arguments on the Arguments tab.

    -Dcom.wowza.wms.logging.LogNotify=[your.custom.Class]
    The IDE does not use the files in the [install-dir]/bin folder when running Wowza.

    Roger.
    I am not running the IDE. I am using Netbeans and then I copy the .jar files in the [wowza]/lib folder

  6. #6
    Join Date
    Dec 2013
    Posts
    8

    Default

    Ok. I am out of ideas....

    Does anybody know how to do this??

    Documentation on the api is nonexistent!

  7. #7
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Sorry, I was out yesterday. I've been through this and getting same result. Everything is working correctly except getting those values are not in the log. I assume the configuration change is affecting this. I will have to get back to you.

    Richard

  8. #8
    Join Date
    Dec 2013
    Posts
    8

    Default

    OK thanks.

    Just for the record I did try to create a "WowzaMediaServerPro-Service.conf" file and add the
    wrapper.java.additional.[1]=-
    Dcom.wowza.wms.logging.LogNotify=[full-path-to-your-ILogNotify-class]
    but again with no results.

  9. #9
    Join Date
    Dec 2013
    Posts
    8

    Default

    Hello guys,

    Anybody had any insights with this?

    It has been a long time ago since I have asked for some information with this.
    I don't want to give it up but I would like to see it through.

    I am awaiting for your reply.

  10. #10
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Sorry, we did discuss, have to try a couple of things and get back to you.

    Richard

Page 1 of 2 12 LastLast

Similar Threads

  1. Missing values in log fields in stats log
    By solidx in forum Wowza Streaming Server Java API
    Replies: 3
    Last Post: 12-23-2014, 02:49 AM
  2. Custom Log Entries
    By paulo_mendes_ in forum Server Administration Discussion
    Replies: 15
    Last Post: 03-16-2012, 12:48 PM
  3. How to add custom data to log file
    By cmelendez in forum Server-side Modules and Code Samples Discussion
    Replies: 1
    Last Post: 12-06-2011, 07:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •