WebSphere & log4j

Source: Internet
Author: User

IBM things, it is too troublesome, a log to you replace, too overbearing, Google, incredibly is a universal imagination, but there are related to the solution side

Case, basically seems to be on the was5,was6.1, I do not have the environment, but my side of WAS7 did not try to succeed

Describe the popular configuration of the two types of web

The first type:

in your project \webapp \meta-inf to build a A folder called services, and then set up a named org.apache.commons.logging.logfactory file, add a line inside text:
/span>

Org.apache.commons.logging.impl.Log4jFactory

Can be resolved

The second type:

①、 add under Classpath commons-loggi Ng.properties

Org.apache.commons.logging.log=org.apache.commons.logging.impl.log4jlogger

②,. Change the class load mode to Parent_last

Both of these I did not try to succeed in was 7.

On the occasion of despair, steady, in the little corner of the country had found, the following paragraph described

*a Very strange solution:*
Put in//profiles//properties/
The file commons-logging.properties with:
Priority=1
Org.apache.commons.logging.logfactory=org.apache.c Ommons.logging.impl.LogFactoryImpl
Org.apache.commons.logging.log=org.apache.commons. Logging.impl.Log4JLogger
I don ' t know which of those lines is really important ...

http://fixunix.com/websphere/538047-log4j-commons-logging-was6-1-0-19-a.html

It worked.

The steps are as follows (for Windows, for example):

1, put the well-written configuration of the commons-logging.properties into

D:\IBM\WebSphere\AppServer\profiles\AppSrv01\properties Directory

2, put the Log4j-1.2.14.jar Commons-logging-1.1.1.jar

Under the D:\IBM\WebSphere\AppServer\lib directory

3, will you log4j. The Properties are also placed in the directory under step 2

Do not need to change the class loading gas sequencing, do not want to move the engineering structure, restart the service, the log will take effect, is completely in accordance with the LOG4J configuration file print log.

Current weaknesses: All applications have a log profile that needs to change the configuration of WebSphere itself

Why not people weblogic convenient, almost nothing to move, how to use how to use.

5 Floor jucks2611 2014-09-17 I passed the first method, the log output. Environment is WAS7 4 floor ACCPHC 2011-11-18 WAS7 This problem I also found a lot of methods,
Bloggers ' solutions are less realistic, with multiple applications in a single server environment in a production environment, which can affect other applications.
Direct Logger Log=logger.getlogger (This.getclass ()); Use log4j nothing to match, print the log directly! 3 floor krasonly 2011-10-14 That's because you have two spaces in that commons-logging.properties.
Priority=1
Org.apache.commons.logging.logfactory=org.apache.c Ommons.logging.impl.LogFactoryImpl
Org.apache.commons.logging.log=org.apache. Commons. Logging.impl.Log4JLogger
It starts up. 2 floor sjmz30071360 2011-10-07 My on WAS7.0.0.11, without adding commons-logging.properties configuration files, you can generate the log files normally.
But not normal rename and delete generated files, even if the application can not be stopped.
Only after you stop or restart the server.
Is there any good solution? 1 Floor jiminsc 2011-09-27 I'm was7. Add commons-logging.properties configuration files under Classpath to produce log files normally

WebSphere & log4j

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.