Hi,
As other friend said, you can use the default logging facility provided by JCD or Business Process. In case if you want to generate a new .log file, you need to map log4j properties and specifiy the file name in JCD.
So all the JCD events will be logged into this file.
Thanks
Ramanuja
Hi,
This is with version 5.1.2:
The log4j.jar is available in edesigner\lib\ext. Import the .jar file in the project and import the same file into your JCD, you are using.
comment out the existing logger and place this statement :
public static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger( "LoggingDemo" );
public void receive( com.stc.connector.appconn.file.FileTextMessage input, com.stc.connector.appconn.file.FileApplication FileClient_1 )
throws Throwable
{
PropertyConfigurator.configure( "C:/log4j.properties" );
logger.info( " In JCD " );
FileClient_1.setText( input.getText() );
FileClient_1.write();
logger.info( " Successfully finished executing " );
}
You have to set the logger object "LoggingDemo" in your properties file. You should keep the log4j.properties in c:/.
Let me know if you experience any problems. I expect TargetInvocationException if your file in is not taken etc.
Thanks
Mvelamarthy,... thank you v. much..
it would be more helpful if you could please send me sample log4j.properties file..
i got InvocationTargetException probably since i didn't set the logger object in log4j.properties file. so now i'm trying to do that..
thanx anyway..
cheers..
Hi,
As other friend suggested you can use the existing log4j file or use the below lines: put all these in log4j.properties file
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.append=true
log4j.appender.FILE.bufferSize=8192
log4j.appender.FILE.bufferedIO=false
log4j.appender.FILE.file=/apps/jcaps/logicalhost/logs/isLog4jDemo.log
log4j.appender.FILE.immediateFlush=true
log4j.appender.FILE.maxBackupIndex=10
log4j.appender.FILE.maximumFileSize=10485760
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%d{ISO8601} %-5p [%t] [%c] [%x] %m%n
log4j.rootCategory=INFO, FILE
########################################################################
############################# Log4jDemo ###############################
########################################################################
log4j.logger.Log4jDemo =INFO,AppLogging
log4j.appender.Log4jDemo =org.apache.log4j.RollingFileAppender
log4j.appender.Log4jDemo .File=/apps/jcaps/logicalhost/logs/ApplicationLogging.log
log4j.appender.Log4jDemo .layout=org.apache.log4j.PatternLayout
log4j.appender.Log4jDemo .layout.ConversionPattern=%d{ISO8601} %-5p [%t] [%c] [%x] %m%n
########################################################################
You need to change the file names and path according to your setup.
Hope this helps otherwise please let me know.
Thanks
Hi Mvelamarthy and all,
The log4j properties posted by you, was helpful and is working fine for generating log files.
It can be used for sending log info to log files successfully.
Now, can u or anyone plz let me know what are the log4j properties for sending log info to the database tables in case i also need to send logging info in logging tables in a database ?..
It would be again very helpful if u could post log4j properties for logging to a database!
Thanks a lot for guidance!
cheers..
Hi,
For using log4j with JMSAppender,
Could u please let me know the properties to be specified in log4j.properties. file or can u send me a sample log4j.properties file., if possible.
Also, I would like to know once log messages are published to JMS topic/queue, how they can be retrieved from it?.. Please elaborate.
Thanks,
Irshad