You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Reinis Vicups <to...@orbit-x.de> on 2013/12/08 17:52:25 UTC
OpenEJB 4.6.0 standalone: logging config howto
Hi guys,
I have following application deployed in /app of standalone openejb:
myear.ear
|
|-- lib <- here is the log4j*.jar
|
|-- myapp.jar <- here is log4j.xml
I don't actually want to change /conf/logging.properties and have
openejb to pickup MY log4j.xml config for my application.
Is this possible and if yes, how do I make openejb to use my log4j.xml
for my EAR?
kind regard
reinis
Re: OpenEJB 4.6.0 standalone: logging config howto
Posted by Romain Manni-Bucau <rm...@gmail.com>.
to be honest the libraries are different but the code handling slf4j
is exactly the same. The only difference is tomcat doesn't put
libraries in system classloader and openejb does but since slf4j is
handled by app i don't think it changes anything...would need some
more digging surely.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2013/12/8 Reinis Vicups <to...@orbit-x.de>:
> At first I tried to config openejb the same way I did TomEE.
>
> TomEE works just perfectly! There WAS issue with conflicting slf4j
> implementations in the past in TomEE - in 1.6.0 (release) it is gone!
>
> OpenEJB - different story. I will work now with workaround but think there's
> something smelly about it.
>
>
> On 08.12.2013 19:49, Romain Manni-Bucau wrote:
>>
>> hmm
>>
>> i have to admit i only tested against tomee (= not openejb standalone)
>> and needed to fix a little issue about slf4j (you surely encounter it
>> as well).
>>
>> Maybe check against the snapshot.
>>
>> On xml-apis not sure why we don't provide it.
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2013/12/8 Reinis Vicups <to...@orbit-x.de>:
>>>
>>> Hi
>>>
>>> I tried different approaches and all failed but this one:
>>>
>>> - place slf4j-log4j12-1.7.5.jar; log4j-1.2.17.jar; log4j.xml,
>>> jul-to-slf4j-1.7.5.jar and xml-apis-1.4.01.jar in OPENEJB_ROOT\lib
>>> - change OEPENEJB_ROOT\conf\logging.properties to handlers =
>>> org.slf4j.bridge.SLF4JBridgeHandler
>>>
>>> This way it works although now I changed the whole Openejb to slf4j!
>>> Another thing was necessity to add xml-apis-1.4.01 or I would get class
>>> NoClassDefFoundException for org.w3c.dom.ElementTraversal.
>>>
>>> Thats quite intrusive method and means for me a lot of error-prone work
>>> upon
>>> e.g. openejb upgrade.
>>>
>>> I appreciate any hints on what else I could try. (I tried placing all the
>>> jars and xml in <ear>/lib with no success, I even tried packaging
>>> log4j.xml
>>> in an empty jar and putting it in <ear>\lib and several other methods).
>>>
>>> kind regards
>>> reinis
>>>
>>>
>>> On 08.12.2013 18:46, Romain Manni-Bucau wrote:
>>>>
>>>> Hi
>>>>
>>>> maybe that's cause we miss some details but if log4j.xml is in the
>>>> same loader as log4j.jar (all should be in <ear>/lib/ maybe) it should
>>>> work
>>>> Romain Manni-Bucau
>>>> Twitter: @rmannibucau
>>>> Blog: http://rmannibucau.wordpress.com/
>>>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>>>> Github: https://github.com/rmannibucau
>>>>
>>>>
>>>>
>>>> 2013/12/8 Reinis Vicups <to...@orbit-x.de>:
>>>>>
>>>>> Hi guys,
>>>>>
>>>>> I have following application deployed in /app of standalone openejb:
>>>>>
>>>>> myear.ear
>>>>> |
>>>>> |-- lib <- here is the log4j*.jar
>>>>> |
>>>>> |-- myapp.jar <- here is log4j.xml
>>>>>
>>>>>
>>>>> I don't actually want to change /conf/logging.properties and have
>>>>> openejb
>>>>> to
>>>>> pickup MY log4j.xml config for my application.
>>>>>
>>>>> Is this possible and if yes, how do I make openejb to use my log4j.xml
>>>>> for
>>>>> my EAR?
>>>>>
>>>>> kind regard
>>>>> reinis
>>>
>>>
>
Re: OpenEJB 4.6.0 standalone: logging config howto
Posted by Reinis Vicups <to...@orbit-x.de>.
At first I tried to config openejb the same way I did TomEE.
TomEE works just perfectly! There WAS issue with conflicting slf4j
implementations in the past in TomEE - in 1.6.0 (release) it is gone!
OpenEJB - different story. I will work now with workaround but think
there's something smelly about it.
On 08.12.2013 19:49, Romain Manni-Bucau wrote:
> hmm
>
> i have to admit i only tested against tomee (= not openejb standalone)
> and needed to fix a little issue about slf4j (you surely encounter it
> as well).
>
> Maybe check against the snapshot.
>
> On xml-apis not sure why we don't provide it.
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2013/12/8 Reinis Vicups <to...@orbit-x.de>:
>> Hi
>>
>> I tried different approaches and all failed but this one:
>>
>> - place slf4j-log4j12-1.7.5.jar; log4j-1.2.17.jar; log4j.xml,
>> jul-to-slf4j-1.7.5.jar and xml-apis-1.4.01.jar in OPENEJB_ROOT\lib
>> - change OEPENEJB_ROOT\conf\logging.properties to handlers =
>> org.slf4j.bridge.SLF4JBridgeHandler
>>
>> This way it works although now I changed the whole Openejb to slf4j!
>> Another thing was necessity to add xml-apis-1.4.01 or I would get class
>> NoClassDefFoundException for org.w3c.dom.ElementTraversal.
>>
>> Thats quite intrusive method and means for me a lot of error-prone work upon
>> e.g. openejb upgrade.
>>
>> I appreciate any hints on what else I could try. (I tried placing all the
>> jars and xml in <ear>/lib with no success, I even tried packaging log4j.xml
>> in an empty jar and putting it in <ear>\lib and several other methods).
>>
>> kind regards
>> reinis
>>
>>
>> On 08.12.2013 18:46, Romain Manni-Bucau wrote:
>>> Hi
>>>
>>> maybe that's cause we miss some details but if log4j.xml is in the
>>> same loader as log4j.jar (all should be in <ear>/lib/ maybe) it should
>>> work
>>> Romain Manni-Bucau
>>> Twitter: @rmannibucau
>>> Blog: http://rmannibucau.wordpress.com/
>>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>>> Github: https://github.com/rmannibucau
>>>
>>>
>>>
>>> 2013/12/8 Reinis Vicups <to...@orbit-x.de>:
>>>> Hi guys,
>>>>
>>>> I have following application deployed in /app of standalone openejb:
>>>>
>>>> myear.ear
>>>> |
>>>> |-- lib <- here is the log4j*.jar
>>>> |
>>>> |-- myapp.jar <- here is log4j.xml
>>>>
>>>>
>>>> I don't actually want to change /conf/logging.properties and have openejb
>>>> to
>>>> pickup MY log4j.xml config for my application.
>>>>
>>>> Is this possible and if yes, how do I make openejb to use my log4j.xml
>>>> for
>>>> my EAR?
>>>>
>>>> kind regard
>>>> reinis
>>
Re: OpenEJB 4.6.0 standalone: logging config howto
Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm
i have to admit i only tested against tomee (= not openejb standalone)
and needed to fix a little issue about slf4j (you surely encounter it
as well).
Maybe check against the snapshot.
On xml-apis not sure why we don't provide it.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2013/12/8 Reinis Vicups <to...@orbit-x.de>:
> Hi
>
> I tried different approaches and all failed but this one:
>
> - place slf4j-log4j12-1.7.5.jar; log4j-1.2.17.jar; log4j.xml,
> jul-to-slf4j-1.7.5.jar and xml-apis-1.4.01.jar in OPENEJB_ROOT\lib
> - change OEPENEJB_ROOT\conf\logging.properties to handlers =
> org.slf4j.bridge.SLF4JBridgeHandler
>
> This way it works although now I changed the whole Openejb to slf4j!
> Another thing was necessity to add xml-apis-1.4.01 or I would get class
> NoClassDefFoundException for org.w3c.dom.ElementTraversal.
>
> Thats quite intrusive method and means for me a lot of error-prone work upon
> e.g. openejb upgrade.
>
> I appreciate any hints on what else I could try. (I tried placing all the
> jars and xml in <ear>/lib with no success, I even tried packaging log4j.xml
> in an empty jar and putting it in <ear>\lib and several other methods).
>
> kind regards
> reinis
>
>
> On 08.12.2013 18:46, Romain Manni-Bucau wrote:
>>
>> Hi
>>
>> maybe that's cause we miss some details but if log4j.xml is in the
>> same loader as log4j.jar (all should be in <ear>/lib/ maybe) it should
>> work
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2013/12/8 Reinis Vicups <to...@orbit-x.de>:
>>>
>>> Hi guys,
>>>
>>> I have following application deployed in /app of standalone openejb:
>>>
>>> myear.ear
>>> |
>>> |-- lib <- here is the log4j*.jar
>>> |
>>> |-- myapp.jar <- here is log4j.xml
>>>
>>>
>>> I don't actually want to change /conf/logging.properties and have openejb
>>> to
>>> pickup MY log4j.xml config for my application.
>>>
>>> Is this possible and if yes, how do I make openejb to use my log4j.xml
>>> for
>>> my EAR?
>>>
>>> kind regard
>>> reinis
>
>
Re: OpenEJB 4.6.0 standalone: logging config howto
Posted by Reinis Vicups <to...@orbit-x.de>.
Hi
I tried different approaches and all failed but this one:
- place slf4j-log4j12-1.7.5.jar; log4j-1.2.17.jar; log4j.xml,
jul-to-slf4j-1.7.5.jar and xml-apis-1.4.01.jar in OPENEJB_ROOT\lib
- change OEPENEJB_ROOT\conf\logging.properties to handlers =
org.slf4j.bridge.SLF4JBridgeHandler
This way it works although now I changed the whole Openejb to slf4j!
Another thing was necessity to add xml-apis-1.4.01 or I would get class
NoClassDefFoundException for org.w3c.dom.ElementTraversal.
Thats quite intrusive method and means for me a lot of error-prone work
upon e.g. openejb upgrade.
I appreciate any hints on what else I could try. (I tried placing all
the jars and xml in <ear>/lib with no success, I even tried packaging
log4j.xml in an empty jar and putting it in <ear>\lib and several other
methods).
kind regards
reinis
On 08.12.2013 18:46, Romain Manni-Bucau wrote:
> Hi
>
> maybe that's cause we miss some details but if log4j.xml is in the
> same loader as log4j.jar (all should be in <ear>/lib/ maybe) it should
> work
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2013/12/8 Reinis Vicups <to...@orbit-x.de>:
>> Hi guys,
>>
>> I have following application deployed in /app of standalone openejb:
>>
>> myear.ear
>> |
>> |-- lib <- here is the log4j*.jar
>> |
>> |-- myapp.jar <- here is log4j.xml
>>
>>
>> I don't actually want to change /conf/logging.properties and have openejb to
>> pickup MY log4j.xml config for my application.
>>
>> Is this possible and if yes, how do I make openejb to use my log4j.xml for
>> my EAR?
>>
>> kind regard
>> reinis
Re: OpenEJB 4.6.0 standalone: logging config howto
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
maybe that's cause we miss some details but if log4j.xml is in the
same loader as log4j.jar (all should be in <ear>/lib/ maybe) it should
work
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2013/12/8 Reinis Vicups <to...@orbit-x.de>:
> Hi guys,
>
> I have following application deployed in /app of standalone openejb:
>
> myear.ear
> |
> |-- lib <- here is the log4j*.jar
> |
> |-- myapp.jar <- here is log4j.xml
>
>
> I don't actually want to change /conf/logging.properties and have openejb to
> pickup MY log4j.xml config for my application.
>
> Is this possible and if yes, how do I make openejb to use my log4j.xml for
> my EAR?
>
> kind regard
> reinis