Hi!
I start my project with the STS strub(?) what is in the cxf example package.
Put the log into the config xml:
<bean id="loggingFeature"
class="org.apache.cxf.feature.LoggingFeature">
<property name="prettyLogging" value="true" />
</bean>
<cxf:bus>
<cxf:features>
<ref bean="loggingFeature" />
</cxf:features>
</cxf:bus>
create a log4j2 config file:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Properties>
<property name="sts">${sys:catalina.base}/logs/sts.log</property>
</Properties>
<Appenders>
<File name="sts-all" fileName="${sts}">
<PatternLayout>
<pattern>%d %x [%t] [%-6p] %c{2}.%M() – %m%n</pattern>
</PatternLayout>
</File>
<Console name="ConsoleAppender" target="SYSTEM_OUT">
<PatternLayout pattern="%d %x [%t] [%-6p] %c{2}.%M() – %m%n" />
</Console>
</Appenders>
<Loggers>
<Root level="info" additivity="false">
<AppenderRef ref="sts-all"/>
</Root>
<!--
<Logger name="org.apache.cxf" additivity="false" level="INFO">
<appender-ref ref="sts-all"/>
</Logger>
-->
</Loggers>
</Configuration>
and the config file:
org.apache.cxf.Logger with the content:
org.apache.cxf.common.logging.Log4jLogger
The log is set for INFO.
With this config my logs is not in the console log (its not problem),
but the apache message logs still there
can be character encoding problem?
where can i put a breakpoint for debug?
Thanx
Csaba
On 2019-10-02 20:25, vEnkaTa mohAna rAo SriperumbUdUru wrote:
Hi
I suspect there might be a problem with log4j configuration, I would be
nice if you could share a sample project to simulate the problem.
Thanks
On Wed, Oct 2, 2019 at 9:41 PM Tóth Csaba <ig...@domen.hu> wrote:
Hello!
I try to set up message log for server with spring with log4j2.
I already created the META-INF/cxf/org.apache.cxf.Logger file with the
content: org.apache.cxf.common.logging.Log4jLogger
Set up the log4j2 config file.
insert logging into the cxf-servlet.xml:
<bean id="loggingFeature"
class="org.apache.cxf.feature.LoggingFeature">
<property name="prettyLogging" value="true" />
</bean>
<cxf:bus>
<cxf:features>
<ref bean="loggingFeature" />
</cxf:features>
</cxf:bus>
The cxf working, but only in the eclipse and/or tomcat log, but not with
the log4j (in the console there is the log entry, but not in the log4j
logfile)
The log4j2 working with my custom code (its create the logs)
I't look like dont find the META-INF/cxf/org.apache.cxf.Logger file.
I tried with the
-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger
starting parameter too.
I did lots of google search, but its about
- create the config file (org.apache.cxf.Logger) with
org.apache.cxf.common.logging.Log4jLogger or
org.apache.cxf.common.logging.Slf4jLogger
- set up the org.apache.cxf.feature.LoggingFeature or LoggingInInterceptor
I tried every combination, but not worked (the message only in the
console log, and not int he log4j logfile)
Thanx
Csaba