logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guillaume.ros...@st.com
Subject Problem with add of appender
Date Mon, 07 Jan 2002 08:57:07 GMT
     Hi everybody, I'm new on the list, I'm french (excuse my poor english 
     ;) ), and I decided to subscribe because I have a serious problem with 
     log4j.
     
     I created a component wich is a mix between log4j and taglib;  so that 
     I can write in a JSP
     
     <log:debug category="mycat">debug message</log:debug>
     
     It runs well if the appender is the console; but I would like the 
     appender to be the browser.
     
     I red documentations and I don't think it is possible to add a 
     "jspAppender" in the log4j.properties file, but I succeed in adding a 
     jspAppender in my code.(In the same time I added a console appender in 
     the log4j.properties).
     In fact I had to retrieve the JspWriter of the JSP and simply add the 
     line
     
     JspWriter myJspWriter = pageContext.getOut(); 
     mylog.addAppender(myJspWriter);
     
     
     Here again it runs, BUT it runs only once !!
     
     Indeed, if in my JSP there are multiple log taglibs :
     
     <log:debug category="mycat">debug message</log:debug> <log:info  
     category="mycat">info  message</log:debug> <log:error 
     category="mycat">error message</log:debug>
     
     
     the browser only displays "debug message".
     
     But the concole displays the 3 messages.
     
     So the problem doesn't come from taglib but rather from log4j.
     
     I thinks it acts as the JspWriter stream was closed or reinitialized 
     after the log4j object is destroyed. But why ? and how to do 
     differently ?
     
     
     Thanks for your answers.
     Guillaume


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message