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 Praveen Kumar Hasthalapuram <pr...@gmail.com> on 2006/02/08 15:36:53 UTC

Issue with using both the config files (log4j.xml & log4j.properties)

Hi All,

Currently we are using *log4j.properties* in our product, we have several
log files with respect to modules.
We need to use *filters* for one of the *module* (Say module_1) only.
So, i have configured *log4j.xml* for this module alone to *filter* the
specific messages and
remaining modules(say module_2, module_3 and so on..) configured in *
log4j.properties*.

And i could see some strange behaviour, as *stederr.log* file is filled up
with some module (say module_3) log messages.
Which shouldn't happen.

1. What could be the wrong?

2. Can we use both the files (.xml and .properties) to configure log? Is it
right way to use?

And one more thing is When i ran the application,
the following exception is thrown and it is logged in *stderr.log* file:

33108 [main] ERROR digester.Digester  - Parse Error at line 102 column 11:
The content of element type "web-app" must match
"(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
org.xml.sax.SAXParseException: The content of element type "web-app" must
match
"(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
 at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1196)
 at
org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError(
XMLValidator.java:1781)
 at org.apache.xerces.validators.common.XMLValidator.callEndElement(
XMLValidator.java:1425)
 at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(
XMLDocumentScanner.java:1149)
 at org.apache.xerces.framework.XMLDocumentScanner.parseSome(
XMLDocumentScanner.java:381)
 at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
 at org.apache.commons.digester.Digester.parse(Digester.java:1543)
 at org.apache.catalina.startup.ContextConfig.applicationConfig(
ContextConfig.java:282)
 at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639)
 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(
ContextConfig.java:243)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
LifecycleSupport.java:166)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java
:3567)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
 at org.apache.catalina.core.StandardService.start(StandardService.java:497)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
 at org.apache.catalina.startup.CatalinaService.start(CatalinaService.java
:273)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.BootstrapService.start(BootstrapService.java
:245)
 at org.apache.catalina.startup.BootstrapService.main(BootstrapService.java
:307)

Pl suggest me.

Thanks,
Praveen

Re: Issue with using both the config files (log4j.xml & log4j.properties)

Posted by Praveen Kumar Hasthalapuram <pr...@gmail.com>.
Thanks again Javier..

--Praveen


On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
>
> I've used it in both windows and linux with equal success :)
>
> I don't have a solaris machine handy, but I'd guess it works, too.
>
> On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> wrote:
> >
> > One more basic question,
> > Will all platforms support configuring log4j.xml?
> > Like windows, solaris and Linux?
> >
> > Thanks,
> > Praveen
> >
> > On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com>
> wrote:
> > >
> > > Thanks Javier.
> > >
> > > -- Praveen
> > >
> > > On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
> > >
> > > > Exactly.
> > > >
> > > > cheers,
> > > >
> > > > --
> > > > Javier González Nicolini
> > > >
> > > > On 2/8/06, Praveen Kumar Hasthalapuram < praveen.hasthal@gmail.com>
> > > > wrote:
> > > > >
> > > > > Oh it means, I need to transform entire properties to xml file
> > right?
> > > > >
> > > > > Regards,
> > > > > Praveen
> > > > >
> > > > > On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
> > > > > >
> > > > > > On 2/8/06, Praveen Kumar Hasthalapuram <
> praveen.hasthal@gmail.com>
> > > > > wrote:
> > > > > > >
> > > > > > > Hi All,
> > > > > > >
> > > > > > > Currently we are using *log4j.properties* in our product, we
> > have
> > > > > > several
> > > > > > > log files with respect to modules.
> > > > > > > We need to use *filters* for one of the *module* (Say
> module_1)
> > > > only.
> > > > > > > So, i have configured *log4j.xml* for this module alone to
> > > > *filter*
> > > > > the
> > > > > > > specific messages and
> > > > > > > remaining modules(say module_2, module_3 and so on..)
> configured
> > > > in *
> > > > > > > log4j.properties*.
> > > > > > >
> > > > > > > And i could see some strange behaviour, as *stederr.log* file
> is
> > > > > filled
> > > > > > up
> > > > > > > with some module (say module_3) log messages.
> > > > > > > Which shouldn't happen.
> > > > > > >
> > > > > > > 1. What could be the wrong?
> > > > > > >
> > > > > > > 2. Can we use both the files (.xml and .properties) to
> configure
> > > > log?
> > > > > Is
> > > > > > > it
> > > > > > > right way to use?
> > > > > >
> > > > > >
> > > > > > As far as I know, (somebody please correct me if I'm wrong), you
> > > > can't.
> > > > > > Your
> > > > > > xml file will get read first and that's the configuration that
> > will
> > > > be
> > > > > > used
> > > > > > for the whole system. The .properties file will be ignored.
> > > > > >
> > > > > >
> > > > > > And one more thing is When i ran the application,
> > > > > > > the following exception is thrown and it is logged in *
> > > > stderr.log*file:
> > > > > > >
> > > > > > > 33108 [main] ERROR digester.Digester   - Parse Error at line
> 102
> > > > column
> > > > > > 11:
> > > > > > > The content of element type "web-app" must match
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> >
> "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> > > >
> > > > > > > org.xml.sax.SAXParseException: The content of element type
> > > > "web-app"
> > > > > > must
> > > > > > > match
> > > > > >
> > > > > >
> > > > > > looks like a syntax error in a xml file, perhaps web.xml?
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Javier Gonzalez Nicolini
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>
>
> --
> Javier González Nicolini
>
>

Re: Issue with using both the config files (log4j.xml & log4j.properties)

Posted by Javier Gonzalez <ja...@gmail.com>.
I've used it in both windows and linux with equal success :)

I don't have a solaris machine handy, but I'd guess it works, too.

On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> wrote:
>
> One more basic question,
> Will all platforms support configuring log4j.xml?
> Like windows, solaris and Linux?
>
> Thanks,
> Praveen
>
> On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> wrote:
> >
> > Thanks Javier.
> >
> > -- Praveen
> >
> > On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
> >
> > > Exactly.
> > >
> > > cheers,
> > >
> > > --
> > > Javier González Nicolini
> > >
> > > On 2/8/06, Praveen Kumar Hasthalapuram < praveen.hasthal@gmail.com>
> > > wrote:
> > > >
> > > > Oh it means, I need to transform entire properties to xml file
> right?
> > > >
> > > > Regards,
> > > > Praveen
> > > >
> > > > On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
> > > > >
> > > > > On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com>
> > > > wrote:
> > > > > >
> > > > > > Hi All,
> > > > > >
> > > > > > Currently we are using *log4j.properties* in our product, we
> have
> > > > > several
> > > > > > log files with respect to modules.
> > > > > > We need to use *filters* for one of the *module* (Say module_1)
> > > only.
> > > > > > So, i have configured *log4j.xml* for this module alone to
> > > *filter*
> > > > the
> > > > > > specific messages and
> > > > > > remaining modules(say module_2, module_3 and so on..) configured
> > > in *
> > > > > > log4j.properties*.
> > > > > >
> > > > > > And i could see some strange behaviour, as *stederr.log* file is
> > > > filled
> > > > > up
> > > > > > with some module (say module_3) log messages.
> > > > > > Which shouldn't happen.
> > > > > >
> > > > > > 1. What could be the wrong?
> > > > > >
> > > > > > 2. Can we use both the files (.xml and .properties) to configure
> > > log?
> > > > Is
> > > > > > it
> > > > > > right way to use?
> > > > >
> > > > >
> > > > > As far as I know, (somebody please correct me if I'm wrong), you
> > > can't.
> > > > > Your
> > > > > xml file will get read first and that's the configuration that
> will
> > > be
> > > > > used
> > > > > for the whole system. The .properties file will be ignored.
> > > > >
> > > > >
> > > > > And one more thing is When i ran the application,
> > > > > > the following exception is thrown and it is logged in *
> > > stderr.log*file:
> > > > > >
> > > > > > 33108 [main] ERROR digester.Digester   - Parse Error at line 102
> > > column
> > > > > 11:
> > > > > > The content of element type "web-app" must match
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> > >
> > > > > > org.xml.sax.SAXParseException: The content of element type
> > > "web-app"
> > > > > must
> > > > > > match
> > > > >
> > > > >
> > > > > looks like a syntax error in a xml file, perhaps web.xml?
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Javier Gonzalez Nicolini
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
>


--
Javier González Nicolini

Re: Issue with using both the config files (log4j.xml & log4j.properties)

Posted by Praveen Kumar Hasthalapuram <pr...@gmail.com>.
One more basic question,
Will all platforms support configuring log4j.xml?
Like windows, solaris and Linux?

Thanks,
Praveen

On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> wrote:
>
> Thanks Javier.
>
> -- Praveen
>
> On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
>
> > Exactly.
> >
> > cheers,
> >
> > --
> > Javier González Nicolini
> >
> > On 2/8/06, Praveen Kumar Hasthalapuram < praveen.hasthal@gmail.com>
> > wrote:
> > >
> > > Oh it means, I need to transform entire properties to xml file right?
> > >
> > > Regards,
> > > Praveen
> > >
> > > On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
> > > >
> > > > On 2/8/06, Praveen Kumar Hasthalapuram <praveen.hasthal@gmail.com >
> > > wrote:
> > > > >
> > > > > Hi All,
> > > > >
> > > > > Currently we are using *log4j.properties* in our product, we have
> > > > several
> > > > > log files with respect to modules.
> > > > > We need to use *filters* for one of the *module* (Say module_1)
> > only.
> > > > > So, i have configured *log4j.xml* for this module alone to
> > *filter*
> > > the
> > > > > specific messages and
> > > > > remaining modules(say module_2, module_3 and so on..) configured
> > in *
> > > > > log4j.properties*.
> > > > >
> > > > > And i could see some strange behaviour, as *stederr.log* file is
> > > filled
> > > > up
> > > > > with some module (say module_3) log messages.
> > > > > Which shouldn't happen.
> > > > >
> > > > > 1. What could be the wrong?
> > > > >
> > > > > 2. Can we use both the files (.xml and .properties) to configure
> > log?
> > > Is
> > > > > it
> > > > > right way to use?
> > > >
> > > >
> > > > As far as I know, (somebody please correct me if I'm wrong), you
> > can't.
> > > > Your
> > > > xml file will get read first and that's the configuration that will
> > be
> > > > used
> > > > for the whole system. The .properties file will be ignored.
> > > >
> > > >
> > > > And one more thing is When i ran the application,
> > > > > the following exception is thrown and it is logged in *
> > stderr.log*file:
> > > > >
> > > > > 33108 [main] ERROR digester.Digester   - Parse Error at line 102
> > column
> > > > 11:
> > > > > The content of element type "web-app" must match
> > > > >
> > > > >
> > > >
> > >
> > "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> >
> > > > > org.xml.sax.SAXParseException: The content of element type
> > "web-app"
> > > > must
> > > > > match
> > > >
> > > >
> > > > looks like a syntax error in a xml file, perhaps web.xml?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Javier Gonzalez Nicolini
> > > >
> > > >
> > >
> > >
> >
> >
>

Re: Issue with using both the config files (log4j.xml & log4j.properties)

Posted by Praveen Kumar Hasthalapuram <pr...@gmail.com>.
Thanks Javier.

-- Praveen

On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:

> Exactly.
>
> cheers,
>
> --
> Javier González Nicolini
>
> On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> wrote:
> >
> > Oh it means, I need to transform entire properties to xml file right?
> >
> > Regards,
> > Praveen
> >
> > On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
> > >
> > > On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com>
> > wrote:
> > > >
> > > > Hi All,
> > > >
> > > > Currently we are using *log4j.properties* in our product, we have
> > > several
> > > > log files with respect to modules.
> > > > We need to use *filters* for one of the *module* (Say module_1)
> only.
> > > > So, i have configured *log4j.xml* for this module alone to *filter*
> > the
> > > > specific messages and
> > > > remaining modules(say module_2, module_3 and so on..) configured in
> *
> > > > log4j.properties*.
> > > >
> > > > And i could see some strange behaviour, as *stederr.log* file is
> > filled
> > > up
> > > > with some module (say module_3) log messages.
> > > > Which shouldn't happen.
> > > >
> > > > 1. What could be the wrong?
> > > >
> > > > 2. Can we use both the files (.xml and .properties) to configure
> log?
> > Is
> > > > it
> > > > right way to use?
> > >
> > >
> > > As far as I know, (somebody please correct me if I'm wrong), you
> can't.
> > > Your
> > > xml file will get read first and that's the configuration that will be
> > > used
> > > for the whole system. The .properties file will be ignored.
> > >
> > >
> > > And one more thing is When i ran the application,
> > > > the following exception is thrown and it is logged in *
> stderr.log*file:
> > > >
> > > > 33108 [main] ERROR digester.Digester  - Parse Error at line 102
> column
> > > 11:
> > > > The content of element type "web-app" must match
> > > >
> > > >
> > >
> >
> "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> > > > org.xml.sax.SAXParseException: The content of element type "web-app"
> > > must
> > > > match
> > >
> > >
> > > looks like a syntax error in a xml file, perhaps web.xml?
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Javier Gonzalez Nicolini
> > >
> > >
> >
> >
>
>

Re: Issue with using both the config files (log4j.xml & log4j.properties)

Posted by Javier Gonzalez <ja...@gmail.com>.
Exactly.

cheers,

--
Javier González Nicolini

On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> wrote:
>
> Oh it means, I need to transform entire properties to xml file right?
>
> Regards,
> Praveen
>
> On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
> >
> > On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com>
> wrote:
> > >
> > > Hi All,
> > >
> > > Currently we are using *log4j.properties* in our product, we have
> > several
> > > log files with respect to modules.
> > > We need to use *filters* for one of the *module* (Say module_1) only.
> > > So, i have configured *log4j.xml* for this module alone to *filter*
> the
> > > specific messages and
> > > remaining modules(say module_2, module_3 and so on..) configured in *
> > > log4j.properties*.
> > >
> > > And i could see some strange behaviour, as *stederr.log* file is
> filled
> > up
> > > with some module (say module_3) log messages.
> > > Which shouldn't happen.
> > >
> > > 1. What could be the wrong?
> > >
> > > 2. Can we use both the files (.xml and .properties) to configure log?
> Is
> > > it
> > > right way to use?
> >
> >
> > As far as I know, (somebody please correct me if I'm wrong), you can't.
> > Your
> > xml file will get read first and that's the configuration that will be
> > used
> > for the whole system. The .properties file will be ignored.
> >
> >
> > And one more thing is When i ran the application,
> > > the following exception is thrown and it is logged in *stderr.log*file:
> > >
> > > 33108 [main] ERROR digester.Digester  - Parse Error at line 102 column
> > 11:
> > > The content of element type "web-app" must match
> > >
> > >
> >
> "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> > > org.xml.sax.SAXParseException: The content of element type "web-app"
> > must
> > > match
> >
> >
> > looks like a syntax error in a xml file, perhaps web.xml?
> >
> >
> >
> >
> >
> > --
> > Javier Gonzalez Nicolini
> >
> >
>
>

Re: Issue with using both the config files (log4j.xml & log4j.properties)

Posted by Praveen Kumar Hasthalapuram <pr...@gmail.com>.
Oh it means, I need to transform entire properties to xml file right?

Regards,
Praveen

On 2/8/06, Javier Gonzalez <ja...@gmail.com> wrote:
>
> On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> wrote:
> >
> > Hi All,
> >
> > Currently we are using *log4j.properties* in our product, we have
> several
> > log files with respect to modules.
> > We need to use *filters* for one of the *module* (Say module_1) only.
> > So, i have configured *log4j.xml* for this module alone to *filter* the
> > specific messages and
> > remaining modules(say module_2, module_3 and so on..) configured in *
> > log4j.properties*.
> >
> > And i could see some strange behaviour, as *stederr.log* file is filled
> up
> > with some module (say module_3) log messages.
> > Which shouldn't happen.
> >
> > 1. What could be the wrong?
> >
> > 2. Can we use both the files (.xml and .properties) to configure log? Is
> > it
> > right way to use?
>
>
> As far as I know, (somebody please correct me if I'm wrong), you can't.
> Your
> xml file will get read first and that's the configuration that will be
> used
> for the whole system. The .properties file will be ignored.
>
>
> And one more thing is When i ran the application,
> > the following exception is thrown and it is logged in *stderr.log* file:
> >
> > 33108 [main] ERROR digester.Digester  - Parse Error at line 102 column
> 11:
> > The content of element type "web-app" must match
> >
> >
> "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> > org.xml.sax.SAXParseException: The content of element type "web-app"
> must
> > match
>
>
> looks like a syntax error in a xml file, perhaps web.xml?
>
>
>
>
>
> --
> Javier Gonzalez Nicolini
>
>

Re: Issue with using both the config files (log4j.xml & log4j.properties)

Posted by Javier Gonzalez <ja...@gmail.com>.
On 2/8/06, Praveen Kumar Hasthalapuram <pr...@gmail.com> wrote:
>
> Hi All,
>
> Currently we are using *log4j.properties* in our product, we have several
> log files with respect to modules.
> We need to use *filters* for one of the *module* (Say module_1) only.
> So, i have configured *log4j.xml* for this module alone to *filter* the
> specific messages and
> remaining modules(say module_2, module_3 and so on..) configured in *
> log4j.properties*.
>
> And i could see some strange behaviour, as *stederr.log* file is filled up
> with some module (say module_3) log messages.
> Which shouldn't happen.
>
> 1. What could be the wrong?
>
> 2. Can we use both the files (.xml and .properties) to configure log? Is
> it
> right way to use?


As far as I know, (somebody please correct me if I'm wrong), you can't. Your
xml file will get read first and that's the configuration that will be used
for the whole system. The .properties file will be ignored.


And one more thing is When i ran the application,
> the following exception is thrown and it is logged in *stderr.log* file:
>
> 33108 [main] ERROR digester.Digester  - Parse Error at line 102 column 11:
> The content of element type "web-app" must match
>
> "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> org.xml.sax.SAXParseException: The content of element type "web-app" must
> match


looks like a syntax error in a xml file, perhaps web.xml?





--
Javier Gonzalez Nicolini