Hello,
I have been able to get log4j working and my cxf service working.
I get my coded log entries AND the soap messages in the console. 
However, I only get my coded log entries in the log file and NOT the soap
messages.
Anyone have an idea of what I am missing to make the soap messages show in
the log file too?
I am using cxf 2.7.12 and log4j2.

Right now I made a simple test service to try and debug this.  Here is what
I have:
---------------------------
I am starting my server with:
                TestServicePortTypeImpl implementor = new 
TestServicePortTypeImpl();
                String address = "http://localhost:";
                                + Settings.getString("WEB_SERVICE_PORT") + 
"/TestService";
                Endpoint.publish(address, implementor);

---------------------------
I am running my service in Eclipse with these arguments:

-Dcxf.config.file=cxf_config.xml
-Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger

---------------------------
In my cxf.xml config file I have:
    <cxf:bus>
        <cxf:features>
            <cxf:logging/>
        </cxf:features>
    </cxf:bus> 

---------------------------
In my log4j2.xml config file I have:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
        <Appenders>
                <Console name="Console" target="SYSTEM_OUT">
                        <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level 
%logger{36} -
%msg%n"/>
                </Console>
                <File name="File" fileName="logs/testservice1.log">
                        <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level 
%logger{36} -
%msg%n"/>
                </File>
        </Appenders>
        <Loggers>
                <Root level="all">
                        <AppenderRef ref="Console"/>
                        <AppenderRef ref="File"/>
                </Root>
        </Loggers>
</Configuration>
---------------------------

I know the service is starting and answering calls.
I know the cxf config is getting picked up because the soap message logging
to the console showed up when I added that.
I know the log4j config is getting picked up and that messages are logging
there because I see them in the file.
I am guessing there is some small piece of config I am missing, but I have
followed all the doc for how to set up cxf logging and log4j, and the
problem still persists.

Thanks,
David





--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-Logging-log4j-shows-in-Console-but-not-in-File-tp5752695.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to