[opencms-dev] Log-Configuration on JBoss 7.2.0

Thomas G. guo.tuomi at googlemail.com
Fri Mar 14 17:15:36 CET 2014


Hi,

I got it working to some extent, by removing the log4j.properties file.
In that case OpenCMS seems to just rely on the already defined loggers and
will use those.

So I get log output now but I can't define log levels on a per application
basis.
I'll dig some more but at least I'm getting the log output again.

Thomas


2014-03-13 18:48 GMT+01:00 Thomas G. <guo.tuomi at googlemail.com>:

> Hi Stephan,
>
> I added the dependency but still no luck.
>
> My jboss-deployment-structure.xml now looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss-deployment-structure>
>     <deployment>
>         <dependencies>
>             <module name="org.jboss.logmanager"/>
>             <module name="org.jboss.log4j.logmanager" />
>             <module name="org.apache.log4j" />
>             <module name="org.slf4j" />
>             <module name="org.slf4j.impl" />
>         </dependencies>
>     </deployment>
> </jboss-deployment-structure>
>
> Nothing too fancy here.
>
> I debugged a bit and noticed that both our application which logs to JBoss
> and OpenCMS use the same JBoss LogManager instance, so there must be at
> least some integration. However, the OpenCMS loggers (the top level logger
> within my module class being a SLF4JLocationAwareLog)  don't reference
> properly configured loggers, i.e. if I dig deeper I find a JBoss LoggerNode
> hierarchy which just references an empty JBossAppenderHandler without any
> inner appenders.
>
> So the log manager seems to get called correctly, but the configuration of
> the loggers seems to be broken.
>
> In order to confirm that I didn't accidentially break the log4j
> configuration I copied the log4j.properties file from a fresh OpenCMS 8.0.4
> war, which defines the loggers as
>
>    # Per default we use WARN debug level and just one appender
> log4j.rootLogger=\
>     ERROR,\
>     OC,\
>     CONSOLE #Console was commented by default
>
> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
> log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
> ...
> log4j.appender.OC=org.apache.log4j.RollingFileAppender
> ...
>
> Thomas
>
>
> 2014-03-13 14:26 GMT+01:00 Stephan Schrader <zstephanz at gmail.com>:
>
> Hi Thomas,
>>
>> you're right, I just tried and the missing part is to add another module
>> to the deployment-structure file:
>> <module name="org.apache.log4j" />
>>
>> Stephan
>>
>>
>> 2014-03-13 12:58 GMT+01:00 Thomas G. <guo.tuomi at googlemail.com>:
>>
>> Hi Stephan,
>>>
>>> unfortunately it's not working. I added dependencies to modules
>>> org.jboss.logmanager and org.jboss.log4j.logmanager but I don't get any
>>> output on the console or in the server.log file.
>>>
>>> There are log statements in our Java classes which are included in our
>>> modules as well as in the JSPs.
>>>
>>> So there are at least 3 places where log statements are executed:
>>>
>>> - during startup (which is written to opencms.log but is missing in the
>>> JBoss logs or on the console)
>>> - within Java classes (which are also missing)
>>> - in JSP scriptlets (which are written to the JBoss log, presumably
>>> because JBoss Web is inserting its own logger into the JSPs)
>>>
>>> Any further ideas?
>>> Which OpenCMS version are you using?
>>>
>>> Thanks again
>>>
>>> Thomas
>>>
>>>
>>> 2014-03-12 22:54 GMT+01:00 guo.tuomi <guo.tuomi at googlemail.com>:
>>>
>>>> Hi Stephan, Arash,
>>>>
>>>> thanks for the tip, I'll check that tomorrow.
>>>>
>>>> @Arash we have a similar use case where OpenCMS used as content
>>>> provider for another application which depends on JPA, EJB and CDI.
>>>>
>>>> We as well don't have much experience with TomEE, since we've been
>>>> working with JBoss for years now.
>>>>
>>>> Thomas
>>>>
>>>> Von Samsung Mobile gesendet
>>>>
>>>> Hi Stephan, Arash,
>>>>
>>>> thanks for the tip, I'll check that tomorrow.
>>>>
>>>> @Arash we have a similar use case where OpenCMS used as content
>>>> provider for another application which depends on JPA, EJB and CDI.
>>>>
>>>> We as well don't have much experience with TomEE, since we've been
>>>> working with JBoss for years now.
>>>>
>>>> Thomas
>>>>
>>>> Von Samsung Mobile gesendet
>>>> <br><br><div>-------- Ursprüngliche Nachricht --------</div><div>Von:
>>>> Stephan Schrader <zstephanz at gmail.com> </div><div>Datum:12.03.2014
>>>>  21:11  (GMT+01:00) </div><div>An: The OpenCms mailing list <
>>>> opencms-dev at opencms.org> </div><div>Betreff: Re: [opencms-dev]
>>>> Log-Configuration on JBoss 7.2.0 </div><div><br></div>
>>>>
>>>> Hey Arash,
>>>>
>>>> for me the absolute killer feature is the domain mode. With that, I can
>>>> easily setup stage and live server or even running different webapps in
>>>> independent server processes. Another thing I really love, when using JBoss
>>>> LogManger, is to switch log levels at runtime.
>>>>
>>>> An use case we have often is, having OpenCms to deliver content and
>>>> another integrated (or merged) webapp as a backoffice. The backoffice
>>>> depends on JPA und CDI (I don't like Spring at all) and also uses the
>>>> OpenCms as identity store, sending mails, ....
>>>>
>>>> I don't have any experience with TomEE.
>>>>
>>>> Stephan
>>>>
>>>>
>>>> 2014-03-12 19:51 GMT+01:00 Arash Kaffamanesh <ak at cloudssky.com>:
>>>>
>>>>> Hi Thomas, Stephan,
>>>>>
>>>>> I'm very interested to know, why you are using JBoss and which
>>>>> benefits it has compared to Tomcat or TomEE.
>>>>>
>>>>> Thanks for your feedback in advance!
>>>>>
>>>>> Kind Regards,
>>>>> Arash
>>>>>
>>>>> Like <https://www.facebook.com/cloudssky> | Follow<https://twitter.com/CLOUDSSKYONE>
>>>>>  | Build your CloudSite with OpenCms OCCX<http://cloudssky.com/en/cloud_services/cloudsites.html>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Mar 12, 2014 at 7:02 PM, Stephan Schrader <zstephanz at gmail.com
>>>>> > wrote:
>>>>>
>>>>>> Hi Thomas,
>>>>>>
>>>>>> in our projects we had to include the "org.jboss.logmanager" module.
>>>>>> You can declare this inside the jboss-deployment-structure.xml, like this:
>>>>>> <jboss-deployment-structure
>>>>>> xmlns="urn:jboss:deployment-structure:1.0">
>>>>>>     <deployment>
>>>>>>         <dependencies>
>>>>>>             <module name="org.jboss.logmanager"/>
>>>>>>         </dependencies>
>>>>>>     </deployment>
>>>>>> </jboss-deployment-structure>
>>>>>>
>>>>>> After that all log messages will appear in the JBoss server.log.
>>>>>>
>>>>>> Stephan
>>>>>>
>>>>>>
>>>>>> 2014-03-12 16:57 GMT+01:00 Thomas G. <guo.tuomi at googlemail.com>:
>>>>>>
>>>>>>>  Hi,
>>>>>>>
>>>>>>> we're running a OpenCMS 8.0.4 instance on a JBoss 7.2.0 but have
>>>>>>> problems getting the logging to work correctly.
>>>>>>>
>>>>>>> Logging works in that opencms.log is written but we require the
>>>>>>> OpenCMS logger to append to the JBoss logger, i.e. both JBoss and OpenCMS
>>>>>>> should log to the console and JBoss' server.log file.
>>>>>>>
>>>>>>> Previously the same OpenCMS instance was running on a JBoss 4.2.3.GAinstance where everything worked as expected.
>>>>>>>
>>>>>>> Here's an excerpt from our log4j.properties file:
>>>>>>>
>>>>>>> log4j.rootLogger=\
>>>>>>>     OC,\
>>>>>>>     CONSOLE
>>>>>>>
>>>>>>> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
>>>>>>>
>>>>>>> log4j.appender.OC=org.apache.log4j.RollingFileAppender
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> We tried a couple of things, like exluding log4j, slf4j etc. or
>>>>>>> placing jcl-over-slf4j etc. into OpenCMS' lib folder, but had no success
>>>>>>> yet.
>>>>>>>
>>>>>>> Any ideas?
>>>>>>>
>>>>>>> Thanks in advance,
>>>>>>>
>>>>>>> Thomas
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> This mail is sent to you from the opencms-dev mailing list
>>>>>>> To change your list options, or to unsubscribe from the list, please
>>>>>>> visit
>>>>>>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> This mail is sent to you from the opencms-dev mailing list
>>>>>> To change your list options, or to unsubscribe from the list, please
>>>>>> visit
>>>>>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> This mail is sent to you from the opencms-dev mailing list
>>>>> To change your list options, or to unsubscribe from the list, please
>>>>> visit
>>>>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> Hey Arash,
>>>>
>>>> for me the absolute killer feature is the domain mode. With that, I can
>>>> easily setup stage and live server or even running different webapps in
>>>> independent server processes. Another thing I really love, when using JBoss
>>>> LogManger, is to switch log levels at runtime.
>>>>
>>>> An use case we have often is, having OpenCms to deliver content and
>>>> another integrated (or merged) webapp as a backoffice. The backoffice
>>>> depends on JPA und CDI (I don't like Spring at all) and also uses the
>>>> OpenCms as identity store, sending mails, ....
>>>>
>>>> I don't have any experience with TomEE.
>>>>
>>>> Stephan
>>>>
>>>>
>>>> 2014-03-12 19:51 GMT+01:00 Arash Kaffamanesh <ak at cloudssky.com>:
>>>> Hi Thomas, Stephan,
>>>>
>>>> I'm very interested to know, why you are using JBoss and which benefits
>>>> it has compared to Tomcat or TomEE.
>>>>
>>>> Thanks for your feedback in advance!
>>>>
>>>> Kind Regards,
>>>> Arash
>>>>
>>>> Like | Follow | Build your CloudSite with OpenCms OCCX
>>>>
>>>>
>>>>
>>>> On Wed, Mar 12, 2014 at 7:02 PM, Stephan Schrader <zstephanz at gmail.com>
>>>> wrote:
>>>> Hi Thomas,
>>>>
>>>> in our projects we had to include the "org.jboss.logmanager" module.
>>>> You can declare this inside the jboss-deployment-structure.xml, like this:
>>>> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
>>>>     <deployment>
>>>>         <dependencies>
>>>>             <module name="org.jboss.logmanager"/>
>>>>         </dependencies>
>>>>     </deployment>
>>>> </jboss-deployment-structure>
>>>>
>>>> After that all log messages will appear in the JBoss server.log.
>>>>
>>>> Stephan
>>>>
>>>>
>>>> 2014-03-12 16:57 GMT+01:00 Thomas G. <guo.tuomi at googlemail.com>:
>>>> Hi,
>>>>
>>>> we're running a OpenCMS 8.0.4 instance on a JBoss 7.2.0 but have
>>>> problems getting the logging to work correctly.
>>>>
>>>> Logging works in that opencms.log is written but we require the OpenCMS
>>>> logger to append to the JBoss logger, i.e. both JBoss and OpenCMS should
>>>> log to the console and JBoss' server.log file.
>>>>
>>>> Previously the same OpenCMS instance was running on a JBoss 4.2.3.GAinstance where everything worked as expected.
>>>>
>>>> Here's an excerpt from our log4j.properties file:
>>>>
>>>> log4j.rootLogger=\
>>>>     OC,\
>>>>     CONSOLE
>>>>
>>>> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
>>>>
>>>> log4j.appender.OC=org.apache.log4j.RollingFileAppender
>>>>
>>>>
>>>>
>>>> We tried a couple of things, like exluding log4j, slf4j etc. or placing
>>>> jcl-over-slf4j etc. into OpenCMS' lib folder, but had no success yet.
>>>>
>>>> Any ideas?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Thomas
>>>>
>>>> _______________________________________________
>>>> This mail is sent to you from the opencms-dev mailing list
>>>> To change your list options, or to unsubscribe from the list, please
>>>> visit
>>>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> This mail is sent to you from the opencms-dev mailing list
>>>> To change your list options, or to unsubscribe from the list, please
>>>> visit
>>>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> This mail is sent to you from the opencms-dev mailing list
>>>> To change your list options, or to unsubscribe from the list, please
>>>> visit
>>>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> This mail is sent to you from the opencms-dev mailing list
>>> To change your list options, or to unsubscribe from the list, please
>>> visit
>>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>>
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20140314/f5346466/attachment.htm>


More information about the opencms-dev mailing list