Ceki Culce,<br><br>That worked.....<br>Awesome. Thank You.<br>I'd like to ask you another question....<br>I'd like to use Logback instead of Log4j however Log4j server along with Log4cxx client and with SocketAppender<br>
"understand" each other. That is, I can log with log4j Server messages (with the SocketAppender) that are<br>coming from the Log4cxx clients and of course log4j clients. Then, I can write all these log messages to just one file<br>
on a server where my Log4j server is running. <br>This is what I'm really after. I know that Log4j, and I assume also logback as well, has JMSAppender. <br>I don't know that much (yet) about JMS but I wonder if there's a way to use it to write messages coming<br>
from C++ client, Java or whatever client we may have.... (I know I need to handle Flex clients as well, Oh man!)<br>I know you more knowledgeble in this area........ <br>Please let me know if there is a way to "capture" all these different log messages coming from different clients somehow<br>
and persist them to one repository (like a DB or a flat txt file) <br>Thanks<br>Greg.<br><br><br><br><br><div class="gmail_quote">On Wed, Mar 18, 2009 at 2:39 PM, Ceki Gulcu <span dir="ltr"><ceki@qos.ch></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello Greg,<br>
<br>
I have not looked at log4j 1.3 code for a long time. Here is some code<br>
that will probably do what you want:<br>
<br>
// code for log4j 1.3 and not logback<div class="im"><br>
logger = org.apache.log4j.Logger.getLogger(className);<br>
JoranConfigurator jc = new JoranConfigurator();<br>
jc.doConfigure(configFile, LogManager.getLoggerRepository());<br></div>
ExecutionContext ec = jc.getExecutionContext();<br>
for(Object o: ec.getErrorList()) {<br>
System.out.println(o);<br>
}<br>
<br>
Again the above code is for log4j 1.3 not logback.<br>
<br>
HTH,<br>
<br>
Greg Flex wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Hi Ceki Gülcü,<br>
<br>
Thanks for your fast reply.<br>
So the problem is that I'm not using the Logback but the Log4j 1.3 alpha 8 version that also has<br></div>
JoranConfigurator object. (author: Curt Arnold, Ceki Gülcü <<a href="http://www.qos.ch/log4j/" target="_blank">http://www.qos.ch/log4j/</a>>)<div class="im"><br>
I thought I ask you since you've written it and you more likely to reply to my message from this forum.<br>
I'm looking at the (Log4j 1.3 alpha 8) API and don't see any LoggerContext object there.<br>
I have at the moment this in my class:<br>
<br>
public someConstructor(String className, String propertyFile) {<br>
//Reads the configuration file.<br>
if (!configFile.endsWith("xml") || configFile == ""){<br>
throw new InvalidParameterException("Invalid XML property file.");<br>
}<br>
logger = org.apache.log4j.Logger.getLogger(className);<br>
JoranConfigurator jc = new JoranConfigurator();<br>
jc.doConfigure(configFile, LogManager.getLoggerRepository());<br>
}<br>
<br>
</div></blockquote><div><div></div><div class="h5">
-- <br>
Ceki Gülcü<br>
Logback: The reliable, generic, fast and flexible logging framework for Java.<br>
<a href="http://logback.qos.ch" target="_blank">http://logback.qos.ch</a><br>
_______________________________________________<br>
Logback-user mailing list<br>
Logback-user@qos.ch<br>
<a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
</div></div></blockquote></div><br>