[Red5] tomcat/war logback workaround

Harley Powers Parks harley at hitushawaii.com
Sun Nov 9 07:14:05 PST 2008


 
Hey... Thanks. I tried to make red5 work with tomcat and never had any
success. I have only been able to use the install which works well.
 
 
Harley Powers Parks
Geospatial Visualization Director
Hi-Tech Urban Solutions, Inc.
1003 Bishop Street
Pauahi Tower, Suite 704
Honolulu, Hawaii 96813
ph.: 808.537.2214
fax: 808.537.2215
 
harley at hitushawaii.com
 
http://www.hitushawaii.com/

-----Original Message-----
From: red5-bounces at osflash.org [mailto:red5-bounces at osflash.org] On
Behalf Of devon girard
Sent: Saturday, November 08, 2008 5:27 PM
To: red5 at osflash.org
Subject: Re: [Red5] tomcat/war logback workaround


forgot to mention, this thread was helpful for me in gaining general
comfort with logback:

http://www.nabble.com/Trouble-setting-up-logback-in-tomcat.-td7986823.ht
ml#a7986823


On Sat, Nov 8, 2008 at 6:45 PM, devon girard <dsgirard at gmail.com> wrote:


after quite a bit of snooping, googling, nabbling, trial and error, I've
got my custom application running under tomcat....  yeah ~

I'm not suggesting any of the following is best-practice, however it's
what I needed to do to get this working:

-- first off, I opted for an internal application, meaning my
application is deployed within ROOT. For me this is fine.
-- for an internal .war deployment, the ONLY config file I needed was
webapps\ROOT\WEB-INF\classes\myApp-web.xml (defines my application
context, scope and handler)
-- all class files go in webapps\ROOT\WEB-INF\classes\

Without logging, that was it! Green light!

However, I need logging...

-- in order to get the error.log and red5.log files to generate, I had
to change the log file path values to begin with ${catalina.home}, for
example ${catalina.home}/logs/error.log

 -- I was NEVER able to get logback-myApp.xml to define my custom
appender properly, so I put my appender and blogger definition at the
end of webapps\ROOT\WEB-INF\classes\logback.xml
-- the failure for the logging context to load was causing my
application to crash as I instantiated the logger... this line was
triggering a null exception:

            log = loggerContext.getLogger(Application.class); 

-- changing to the following, ugly though it may be, solved all my
problems and saved my marriage:

            loggerContext = selector.getLoggerContext("myApp");
            if (loggerContext == null)
                  loggerContext = selector.getDefaultLoggerContext();
            log = loggerContext.getLogger("myApp");

The result is all output logging to myApp.log in tomcat's logs directory
;)

d
 

www.snowscape.ca





-- 

www.snowscape.ca


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20081109/44375aa4/attachment-0001.html>


More information about the Red5 mailing list