Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to configure log4j.xml to get the debug info of "javax.net.debug"

I want to get the LDAP connect ssl handshake debug info ,so I set the system property "javax.net.debug" value "ssl,handshake" like this :

System.property("javax.net.debug" , "ssl,handshake"); but I didn't get the ssl debug info.In my project,using log4j.xml to control the debug info, so I want to know how to configure log4j.xml to get the debug info of "javax.net.debug"? Thanks for your help!

like image 434
user3104773 Avatar asked Oct 02 '22 12:10

user3104773


1 Answers

Classes inside javax.net package would not write to Log4J appenders (infact they do not use Log4J library at all). Most probably they would output debug messages to STDOUT or STDERR streams of the running java process. Redirect these streams to file(s) on the disk and then you can get those messages logged in the file(s). If you are using some server (e.g. Tomcat or JBoss) then read the server's document on how to control I/O streams from these processes.

Log4j.xml has nothing to do here.

EDIT: If you are using Tomcat (or Jboss) then you may need to check the Log threshold for ConsoleAppender in log4j.xml. By default it is set as INFO and redirected to console.log file inside logs directory.

like image 137
Bimalesh Jha Avatar answered Oct 18 '22 07:10

Bimalesh Jha