Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 9th, 2006, 10:18 AM
MuffinMan MuffinMan is offline
Source of Wisdom
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Germany, Munich Southside
Posts: 156 MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 10 h 8 m 48 sec
Reputation Power: 17
Send a message via ICQ to MuffinMan Send a message via AIM to MuffinMan
Logging soap messages to file with log4j

Hey folks, got a problem:

I'm trying to log the soap messages reaching/leaving my server (websphere).

I'm using log4j and this is my config file (part of it):

Code:
log4j.logger.org.apache.axis=DEBUG, WebserviceLogAppender
log4j.logger.org.apache.axis.TIME=WARN

log4j.appender.WebserviceLogAppender=org.apache.log4j.FileAppender
log4j.appender.WebserviceLogAppender.File=D:\\WebSphere\\AppServer\\logs\\server1\\webservice.log
log4j.appender.WebserviceLogAppender.Append=true
log4j.appender.WebserviceLogAppender.Threshold=DEBUG
log4j.appender.WebserviceLogAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.WebserviceLogAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n


as nothing happened I assumed the log-configs within the axis.jar were overwriting my settings so I deleted them within the jar - didn't have any influence so far. the overall log level is debug

I don't get any logging info, not just no soap messages but nothing at all - all my other logs are running perfect it's just axis

any idea on this?

and do you know if debug would be sufficient to get the soap messages (at best together with the envelope but that's not really necessary)
__________________
Everything you own ends up owning you

Reply With Quote
  #2  
Old May 9th, 2006, 10:36 AM
stdunbar's Avatar
stdunbar stdunbar is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 2,398 stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 18 h 15 m 45 sec
Reputation Power: 1660
Send a message via Yahoo to stdunbar Send a message via Google Talk to stdunbar
I'd start with figuring out why log4j isn't giving you anything. On the command line that starts up WebPhere pass -Dlog4j.debug to turn on log4j debugging. It will print debugging information to the console (stdout a.k.a. System.out)
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
  #3  
Old May 9th, 2006, 11:02 AM
MuffinMan MuffinMan is offline
Source of Wisdom
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Germany, Munich Southside
Posts: 156 MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 10 h 8 m 48 sec
Reputation Power: 17
Send a message via ICQ to MuffinMan Send a message via AIM to MuffinMan
tried that - I'm logging the console output to a file but it didn't receive any log4j debug info - could this be set int the log4j.properties as well? if so what would be the line?

Reply With Quote
  #4  
Old May 9th, 2006, 11:13 AM
stdunbar's Avatar
stdunbar stdunbar is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 2,398 stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 18 h 15 m 45 sec
Reputation Power: 1660
Send a message via Yahoo to stdunbar Send a message via Google Talk to stdunbar
Are you also specifying -Dlog4j.configuration? I always find that it is far easier to force log4j to use a particular configuration file rather than having it find it on the classpath. I'm not aware of a way to turn on log4j debugging from the config file.

Reply With Quote
  #5  
Old May 9th, 2006, 11:21 AM
MuffinMan MuffinMan is offline
Source of Wisdom
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Germany, Munich Southside
Posts: 156 MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 10 h 8 m 48 sec
Reputation Power: 17
Send a message via ICQ to MuffinMan Send a message via AIM to MuffinMan
would that be right then:

startserver server1 -Dlog4j.configuration=D:\projects\myapp\doc\config\log4j.properties -Dlog4j.debug

this didn't have any other result... but I'm quite sure anyway that the right log4j.properties is being used as the other logs are working - or is axis maybe using it's own property anyway?

Reply With Quote
  #6  
Old May 9th, 2006, 11:40 AM
stdunbar's Avatar
stdunbar stdunbar is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 2,398 stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 18 h 15 m 45 sec
Reputation Power: 1660
Send a message via Yahoo to stdunbar Send a message via Google Talk to stdunbar
I'm afraid I don't know anything about startserver - a batch file I presume?

Ultimately the -D options must be passed to the Java command. For testing can you make a copy of the startserver file and force those two -D options into the command line? It very well may be doing that already but if you didn't get any log4j debugging then perhaps it isn't passing along the -D's to the Java command.

Reply With Quote
  #7  
Old May 10th, 2006, 03:37 AM
MuffinMan MuffinMan is offline
Source of Wisdom
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Germany, Munich Southside
Posts: 156 MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 10 h 8 m 48 sec
Reputation Power: 17
Send a message via ICQ to MuffinMan Send a message via AIM to MuffinMan
ah right it's a batch: this would be the current start parameters (as in the batch)

"%JAVA_HOME%\bin\java" %WAS_TRACE% %DEBUG% %CONSOLE_ENCODING% "%CLIENTSAS%" "-classpath" "%WAS_CLASSPATH%" "-Dws.ext.dirs=%WAS_EXT_DIRS%" %USER_INSTALL_PROP% "-Dwas.install.root=%WAS_HOME%" "-Dibm.websphere.preload.classes=true" "com.ibm.ws.bootstrap.WSLauncher" "com.ibm.ws.management.tools.WsServerLauncher" "%CONFIG_ROOT%" "%WAS_CELL%" "%WAS_NODE%" %*


thanks a lot for helping stdunbar! probably I'm just missing some important setting I guess after this I will do that:

Last edited by MuffinMan : May 10th, 2006 at 03:39 AM.

Reply With Quote
  #8  
Old May 10th, 2006, 04:13 AM
MuffinMan MuffinMan is offline
Source of Wisdom
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Germany, Munich Southside
Posts: 156 MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level)MuffinMan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 10 h 8 m 48 sec
Reputation Power: 17
Send a message via ICQ to MuffinMan Send a message via AIM to MuffinMan
wohooo - I found it: my project directory has an own /libs and in this is an axis.jar - within the jar is a log4j.properties and the settings in there are having an effect - apart from that I got the axis jar as well in my websphere libs it is being used as well but doesn't get the webservice info... why this is like that - I have no idea, anyway I can now try to manipulate the right library

Reply With Quote
  #9  
Old January 24th, 2013, 04:48 PM
Krzysztof Krzysztof is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 1 Krzysztof User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 12 sec
Reputation Power: 0
Hi
Logging all SOAP requests/respones can be very usefull in debug or incident managment. But there is hard to read soap messages in console using less/more/cat. I have found OtrosLogViewer on apache license, see video on youtube. It's nice because it can open logs from remote machines (using ssh, sftp or samba/cifs) and have sofisticated search functionlity.

Krzysztof

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Logging soap messages to file with log4j

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap