You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Josh Reeves <j....@lycos.com> on 2001/10/11 20:09:56 UTC

Common category root

Hello all! 

May be someone can give me a hand with this. 

AppServer. Lots of EJBs deployed. Some of them are used in
multiple "business threads", depending on the invocation chain
( am I clear here?).
Each client creates its own root category ( i.e. "CurrBizzApp")
and adds its name afterwards ( ".CurrBizzClient"), resulting
in a hierarchy.

Is it possible to refer to the clients' root category inside
the EJB, so that all logging is done by "application", initiated
by the client? ( Ideally we'd like to be able to have a category
in the bean "CurrBizzApp.CurrBean" without passing root
category name to the bean.)

Sorry, if my Q is not clear. Please, let me know.

Your help is appreciated.

Regards,
JB
----
Thank you!


Make a difference, help support the relief efforts in the U.S.
http://clubs.lycos.com/live/events/september11.asp

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


Re: root wrapper

Posted by Ceki Gülcü <cg...@qos.ch>.

It seems good to me. I suggest that you write an error handler 
for your parser so that you can identify the exact place where the error occurs.  
If you don't know how to do this see the latest code in your log4j CVS repository under
../src/java/org/apache/log4j/xml/

Regards, Ceki


At 11:32 11.10.2001 -0700, you wrote:
>I fail to parse the suggested linked file with the following code over
>crimson-jaxp, while ie5 shows it nicely. Can anybody suggest? If I manually
>directly wrap entries with a root, it parses well. May be I need a newer
>parser? How others parse xml formatted logs?
>------------------------code----------------------
>      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
>      DocumentBuilder db = dbf.newDocumentBuilder();
>      Document document = db.parse (XML_WRAPPER_FILE); // fails
>------------------output-------------
>org.xml.sax.SAXParseException: org.apache.crimson.parser/P-076 Unconvertible
>UTF-8 character beginning with 0xa0
>        at
>org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1038)
>        at
>org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1010)
>        at org.apache.crimson.parser.InputEntity.peek(InputEntity.java:841)
>        at org.apache.crimson.parser.Parser2.peek(Parser2.java:2922)
>        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:994)
>        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:485)
>        at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
>        at
>org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
>        at
>org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:1
>73)
>        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:134)
>        at
>com.xmlglobal.goxmldb.test.logging.ParseLog.actualExecute(ParseLog.java:68)
>-------------------------------------------example.log----------------------
>----
><log-entry>
>  <time>1002256390714</time>
>  <priority>INFO</priority>
>  <category>my</category>
>  <message><![CDATA[ <<<< mess, but still parsable ]]></message>
></log-entry>
><log-entry>
>  <time>1002256391225</time>
>  <priority>INFO</priority>
>  <category>my</category>
>  <message><![CDATA[my message for log entry 1]]></message>
></log-entry>
>-------------------------example.log.wrapper.xml-------------
><?xml version="1.0" ?>
><!DOCTYPE logentrys [<!ENTITY logdata SYSTEM "example.log">]>
><logentries>
>  &logdata;
></logentries>
>-----------------------------
>Well it is expected that you include example.log in another file with a top
>level element. The reason for this is to make it more difficult to end up
>with a invalid XML tree if the logging shuts down uncleanly.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

--
Ceki Gülcü - http://qos.ch
Link of the day: http://www.skeptictank.org/isaac.htm


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


root wrapper

Posted by Boris Garbuzov <bo...@xmlglobal.com>.
I fail to parse the suggested linked file with the following code over
crimson-jaxp, while ie5 shows it nicely. Can anybody suggest? If I manually
directly wrap entries with a root, it parses well. May be I need a newer
parser? How others parse xml formatted logs?
------------------------code----------------------
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      Document document = db.parse (XML_WRAPPER_FILE); // fails
------------------output-------------
org.xml.sax.SAXParseException: org.apache.crimson.parser/P-076 Unconvertible
UTF-8 character beginning with 0xa0
        at
org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1038)
        at
org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1010)
        at org.apache.crimson.parser.InputEntity.peek(InputEntity.java:841)
        at org.apache.crimson.parser.Parser2.peek(Parser2.java:2922)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:994)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:485)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
        at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
        at
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:1
73)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:134)
        at
com.xmlglobal.goxmldb.test.logging.ParseLog.actualExecute(ParseLog.java:68)
-------------------------------------------example.log----------------------
----
<log-entry>
  <time>1002256390714</time>
  <priority>INFO</priority>
  <category>my</category>
  <message><![CDATA[ <<<< mess, but still parsable ]]></message>
</log-entry>
<log-entry>
  <time>1002256391225</time>
  <priority>INFO</priority>
  <category>my</category>
  <message><![CDATA[my message for log entry 1]]></message>
</log-entry>
-------------------------example.log.wrapper.xml-------------
<?xml version="1.0" ?>
<!DOCTYPE logentrys [<!ENTITY logdata SYSTEM "example.log">]>
<logentries>
  &logdata;
</logentries>
-----------------------------
Well it is expected that you include example.log in another file with a top
level element. The reason for this is to make it more difficult to end up
with a invalid XML tree if the logging shuts down uncleanly.


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


Re: Common category root

Posted by Ceki Gülcü <cg...@qos.ch>.
At 14:09 11.10.2001 -0400, you wrote:
>Hello all! 
>
>May be someone can give me a hand with this. 
>
>AppServer. Lots of EJBs deployed. Some of them are used in
>multiple "business threads", depending on the invocation chain
>( am I clear here?).
>Each client creates its own root category ( i.e. "CurrBizzApp")
>and adds its name afterwards ( ".CurrBizzClient"), resulting
>in a hierarchy.


What do you mean by each client creates it's own root category?
Log4j root categories cannot be named.


>Is it possible to refer to the clients' root category inside
>the EJB, so that all logging is done by "application", initiated
>by the client? ( Ideally we'd like to be able to have a category
>in the bean "CurrBizzApp.CurrBean" without passing root
>category name to the bean.)
>
>Sorry, if my Q is not clear. Please, let me know.

Nope it ain't clear at all. Sorry.


--
Ceki Gülcü - http://qos.ch
Link of the day: http://www.skeptictank.org/isaac.htm


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