Application specific logging with Log4j on weblogic 8.1

Hi,
For a few days now, I have been trying to implement application specific logging using Log4j (1.2.x) for my 3 applications running on the same server (8.1.6). All three application war files are generated from same source. I followed the example of Jboss in setting up the Hierarchy for logging using RepositorySelector. In my case Java class which implements RepositorySelector is loaded through ServletContextListener from jar file placed in WEB_INF/lib folder and log4j.properties file is in WEB-INF folder of each application.
Independent logging of each application takes place correctly, if the applications are deployed from console. However logging fails if weblogic is shutdown and restarted, in this case logging takes place from 2 classes only implementing filters of each application. Logging from other classes is not taking place. I am spinning my wheels on this and can't seem to figure out what the issue is.
Thanks for any help...below is the snippet of code
Sohan
public static synchronized void init(ServletContext config, String strLogProperties, String webAppName)
throws ServletException {
if( !initialized ) // set the global RepositorySelector
defaultRepository = LogManager.getLoggerRepository();
RepositorySelector theSelector = new MyRepositorySelector();
LogManager.setRepositorySelector(theSelector, guard);
initialized = true;
Hierarchy hierarchy = new Hierarchy(new RootCategory(Level.DEBUG));
loadLog4JConfig(config, hierarchy, strLogProperties, webAppName);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
repositories.put(loader, hierarchy);
config.setAttribute("hierarchy", hierarchy );
public LoggerRepository getLoggerRepository() {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
LoggerRepository repository = (LoggerRepository)repositories.get(loader);
if (repository == null) {
return defaultRepository;
} else {
return repository;
public void LogInit(ServletContext ctx) throws ServletException {
System.out.println("\n\n---------------Log4jInit---------------\n\n");
String strLogProperties = ctx.getInitParameter("Log4JProperties");
System.out.println("Log4j properties " + strLogProperties);
String webAppName = ctx.getInitParameter("LogFileName");
System.out.println("App log File name " + webAppName);
if (webAppName == null ) {
webAppName = getWebAppName(ctx);
System.out.println("Application name = " + webAppName);
MyRepositorySelector.init(ctx, strLogProperties, webAppName);
LOG = Logger.getLogger(this.getClass());
LOG.info("Log message from Log4jInit ServletContextListener");
System.out.println("\n\n---------------Log4jInit: Complete---------------\n\n");
}

Has anyone been able to get around the "Export of object xxx barred" error when
trying to access the object?
Thanks,
Kevin
"Koua" <[email protected]> wrote:
>
I have the same problem when adding listener for COM events. I think
it's a bug
in Weblogic. It seems that no one can help.
Teresa Canales <[email protected]> wrote:
Hi,
I am getting the following error. I am not sure how to fix this. I
looked in everywhere on the admin console and couldn't find anything.
The following is what I am getting....
BEA-210000 Apr 14, 2004 11:05:42 AM EDT servicelayertrain
Error COM Export of object: com.symphonyhealth.user.facade.ejb.User_eecm3e_HomeImpl@2ba3e4
barred
Any help would be greatly appreciated.
Teresa

Similar Messages

  • Want to Generate custom logs with Log4J within Java Embedding activity

    Hi Gurus,
    i want to Generate custom logs with Log4J within Java Embedding activity. For that i have performed some steps, but the log file has not been created.
    ServerSide Configuration:
    *===============*
    1. I have copied the log4j-1.2.15.jar file to the "oracle.soa.ext_11.1.1" location and recreate the oracle.soa.ext.jar file using an-script, which appends the log4j.jar file to the classpath.( That was created successfully)
    2. Specify a File location in log4j.xml for creating the log file. (e.g. (<middleware_home>/config/customLog.log)
    3. Then create a folder and add log4j.xml and log4j.dtd file under the folder.
    4. Modify the startManagedWeblogicServer by adding JAVA_OPTIONS="-Dlog4j.configuration=<middleware_home>/config/log4j.debug.xml”
    5. Then restart the SOA server.
    log4j.xml :
    I have used fileAppender.
    DevelopmentSide Configuration:
    *===================*
    1. Create synchronous BPEL process and Add "JAVA Embedding Activity" inbetween receiveInput and replyOutput activity.
    2.Import the log4j-1.2.15.jar to the project libs
    3.In the BPEL source code, import the Logger class.
    4.Insert the code in the JAVA Embedding Activity
    Logger logger = Logger.getLogger("CustomLog");
    logger.info("CustomeLog " + getTitle());
    Compile and deploy the project into the SOA_server and test it. Test status is completed but log is not created in the mentioned location.
    Ref: http://blog.andrade.inf.br/search/label/Log4j
    Is there any other way to achieve this requirement. Please suggest.
    Thanks in Advance,
    Sharmistha

    You can try this.
    http://veejai24.blogspot.co.uk/2008/04/simple-way-to-implement-log4j-in-your.html
    Thanks,
    Vijay

  • Create Application specific Log under NetWeaver 7.1 SP3

    Hi
    I want to create application specific Log and read the following article https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f361cbea-0c01-0010-a3a0-8948bebb0a23
    But I use the NetWeaver 7.1 SP3 and I cannot find the Log-configuration.xml. Please tell me how i can create the application specific log under NetWeaver 7.1 SP3?
    And I find out the documents are not updated for Netweaver 7.1 SP3... It costs more time for me to find out a solution.
    Thanks in advance
    Kind Regards!
    Ping

    Hallo
    I think I find the solution
    start <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool  and use the log configuration to change the settings..
    Please read http://help.sap.com/saphelp_nwce10/helpdata/en/45/6c9bfc02d81c90e10000000a11466f/frameset.htm
    Kind regards!
    Ping

  • Getting empty log files with log4j and WebLogic 10.0

    Hi!
    I get empty log files with log4j 1.2.13 and WebLogic 10.0. If I don't run the application in the application server, then the logging works fine.
    The properties file is located in a jar in the LIB folder of the deployed project. If I change the name of the log file name in the properties file, it just creates a new empty file.
    What could be wrong?
    Thanks!

    I assume that when you change the name of the expected log file in the properties file, the new empty file is that name, correct?
    That means you're at least getting that properties file loaded by log4j, which is a good sign.
    As the file ends up empty, it appears that no logger statements are being executed at a debug level high enough for the current debug level. Can you throw in a logger.error() call at a point you're certain is executed?

  • Separate logging with log4j for web applications deployed on one server

    I have been trying to get web applications to write to separate log files.
    Log4j.jar is loaded through classpath once during weblogic startup. In each web application, I have Log4j.xml or Log4j.properties configuration files under WEB-INF folder. I hava java class in the application extending HttpServlet and loads the log4j.xml file, In web.xml they have load-on-startup set to 1. Two java class files both extending write the log to the specified log file but other java class files are not logging information, some implement filter, some are action classes (Struts 1.2.9). If the java class has a static method then the log from the method is being written but the log from instance methods is not being written. I tried declaring the variable both as static and non-static
    private Logger log = Logger.getLogger(LoginFilter.class);
    What could be causing some java class files not to log?
    Another issue, For Log4j.xml, Doctype as SYSTEM property set to lookup Log4j.dtd, weblogic complains as Log4j.dtd file not found, tried adding this file in WEB-INF folder, same location as LOg4j.xml and WEB-INF/lib folder and even in classpath, weblogic still complains of log4j.dtd file being not found. For now, I removed SYSTEM entry but need to put it back for parser to validate xml file.
    I am using WLS 8.1.6, struts 1.2.9 and Log4j 1.2.8 versions.
    Any help is appreciated.
    thanks,
    SK

    How we can implement thisBy implementing an SSO product of your choice.

  • Logging with log4j

    I'm having a problem doing logging. The problem lies in my log4j.properties file. I want to the log to be in the WEB-INF directory. Here's a log file that works
    log4j.rootLogger=info, R
    log4j.appender.R=org.apache.log4j.RollingFileAppender
    log4j.appender.R.File=${catalina.home}/logs/clprservicing.log
    log4j.appender.R.MaxFileSize=10MB
    log4j.appender.R.MaxBackupIndex=10
    log4j.appender.R.layout=org.apache.log4j.PatternLayout
    log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
    log4j.logger.org.apache.catalina=INFO, RThis properties file is in WEB-INF/classes where it should be. When I change the location of the log to WEB-INF in the following log file
    log4j.rootLogger=info, R
    log4j.appender.R=org.apache.log4j.RollingFileAppender
    log4j.appender.logfile.File=${clpr-servicing.root}/WEB-INF/clprservicing.log
    log4j.appender.R.MaxFileSize=10MB
    log4j.appender.R.MaxBackupIndex=10
    log4j.appender.R.layout=org.apache.log4j.PatternLayout
    log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
    log4j.logger.org.apache.catalina=INFO, Rit doesn't work! The webapplication is called clpr-servicing. Is there something wrong with the key ${clpr-servicing.root}? Does it have to be defined somewhere?

    Never mind. I found the solution.

  • Logging with log4j in a Web app that uses TopLink

    The deployment engineer in my company is reporting problems with our first Web app that uses both log4j and TopLink. Apparently TopLink is failing to initialize correctly when log4j-1.2.8.jar is deployed to the WEB-INF/classes directory within the Web app.
    I know that 9iAS's Enterprise Manager uses an older version of log4j and I wonder if TopLink uses an older version too.
    Are there any known problems when using log4j 1.2.8 with TopLink 9.0.3?
    Thanks,
    Al Margheim

    Unfortunately, when I asked the deployment engineer for more information on the problem, he couldn't provide any, and since he moved the log4j library out of the application's WEB-INF\classes directory he can't reproduce the problem (whatever it was).
    Based on a variety of factors (including your response) I suspect that the people who encountered the problem misinterpreted the cause.
    If I can get him to put the log4j library back in WEB-INF\classes and get more specific information about the problem, and it still looks like a conflict between TopLink and log4j, I'll post the errors here.
    Thanks,
    Al Margheim

  • Create Application specific Log under EP6 SP16

    Hello All
    I have a requirement that i have to configure a customized application log file for a flex application deployed at portal via Visual admin..
    How to go for it...?
    Can ne one tell me or guide me via a step wise procedure related to version of my portal.....
    Help will be appreciated...
    Thanks....
    Edited by: Chetna  Verma on Sep 30, 2008 11:14 AM

    m closing this thread..
    coz no replies...

  • Using other applications (specifically iClicker) with keynote

    I am trying to use iClicker in my keynote presentation. I am able to see the iClicker floating bar and graph on my presenter's view, but I can not get the floating bar to appear on the projected/presentation view. I have selected the appropriate options in Keynote Preferences (i.e., allow others to use the screen), but am still unsuccessful.
    Any ideas?
    Thanks!

    Can you tell the iClicker software which display to use? Have you tried dragging iClicker's main application window to the external display?
    If you can't, then there might be a somewhat kludgy workaround: when you connect to the projector, go into your display preferences, click on the Arrange tab, and move the menu bar to the external display. Then in the Keynote prefs, tell Keynote to present on the primary display instead of the secondary. Changing the arrangement makes the projector your primary display and your normal display the secondary. Keynote doesn't really care which display it uses for what (in fact the default setting is to present on the primary display in a 2-monitor configuration). But if iClicker is insisting on using the primary display, that might be what you need to do to whip it into shape.
    I would start with the iClicker prefs, if any. But failing that, try changing the screens around.
    --Dave Althoff, Jr.

  • SOA Application specific logging

    Is is possible to have separate log files for each SOA application? If so, how to do it?
    Thanks,
    Ram

    Please refer -
    http://docs.oracle.com/cd/E15523_01/core.1111/e10105/logs.htm
    Regards,
    Anuj

  • Logging with WSS4j

    Hello ,
    I'm using Tomcat6 + Axis 1+wss4j.
    I have to modify something in wss4j's source code but I can't test its results...but I couldn't enable logging with log4j..
    How should I do that???
    I could be able to do log with log4j for axis..using the following properties file , placed in folder \Tomcat\webapps\axis\WEB-INF\classes.
    log4j.properties :
    # Set root logger level to WARN and its only appender to A1.
    log4j.rootLogger=WARN, A1
    # show DEBUG for SOAPPart method
    log4j.logger.org.apache.axis.SOAPPart=DEBUG
    # A1 is set to be a ConsoleAppender.
    # log4j.appender.A1=org.apache.log4j.ConsoleAppender
    log4j.appender.A1=org.apache.log4j.FileAppender
    log4j.appender.A1.File=axis.log
    # A1 uses PatternLayout.
    log4j.appender.A1.layout=org.apache.log4j.PatternLayout
    log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
    How do I enable logging with wss4j?
    I tried putting the properties file included with wss4j's source but with no luck..
    Thanks in Advance

    If you are deploying via the WebLogic admin console, here's the reference to configure logging level:
    Administration Console Online Help - [View and configure logs|http://edocs.bea.com/wls/docs103/ConsoleHelp/taskhelp/logging/ConfigureAndViewLogs.html]
    If deploying from command line, try including the -debug flag?
    (weblogic.Deployer Command-Line Reference - [Common Arguments|http://download.oracle.com/docs/cd/E12840_01/wls/docs103/deployment/wldeployer.html#wp1010461])

  • Application specific properties file

    Hello
              Can any body help me how to build application specific properties file
              so that we can have independent application specific server with its own
              java class path environment.I read the procedure in beasys manuals but i
              could'nt understand clearly.
              Setting application-specific properties
              The weblogic.properties file is only accessible by WebLogic; that is,
              you can't add application-specific properties to the weblogic.properties
              file and expect that they will be read at startup time. However, you can
              set properties for your own application by creating a separate
              properties file. This file can be created and used in two ways:
              Put your application-specific properties file in the same directory as
              your weblogic.properties file. You can then use the following code to
              access the properties:
              Properties props = new Properties();
              String propertiesName = "myapp.properties";
              T3ServicesDef services =
              T3Services.getT3Services();
              String location =
              services.config().getProperty("weblogic.system.home") +
              java.io.File.separator + propertiesName;
              props =
              props.load(new DataInputStream(new FileInputStream(location)));
              Thanks in advance
              Ravi
              

    Hi, Ravi.
              I think I am "WeiG".
              Basically, you can not put your own properties on weblogic.properties. Every
              property in weblogic.properties managed by WLAS is pre-registered in WLAS
              internally. WLAS will print "Fund undefined property ...." messages for the
              un-registered property in weblogic.properties files.
              To use your application-specific properties, the paragraph you read suggests
              you create your own file, put it in $WL_HOME, and use the example code to
              read your own file.
              Hope it helps.
              Cheers - Wei
              Ravi <[email protected]> wrote in message
              news:[email protected]...
              > Hi Purdy
              >
              > Who is WeiG,can you tell me please
              >
              > Thanks
              > Ravi
              >
              > Cameron Purdy wrote:
              >
              > > I know that WeiG has answered this before ... try to ask Wei directly.
              > >
              > > --
              > >
              > > Cameron Purdy
              > > http://www.tangosol.com
              > >
              > > "Ravi" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > Hello
              > > >
              > > > Can any body help me how to build application specific properties file
              > > > so that we can have independent application specific server with its
              own
              > > > java class path environment.I read the procedure in beasys manuals but
              i
              > > > could'nt understand clearly.
              > > >
              > > > ************************
              > > > Setting application-specific properties
              > > > The weblogic.properties file is only accessible by WebLogic; that is,
              > > > you can't add application-specific properties to the
              weblogic.properties
              > > > file and expect that they will be read at startup time. However, you
              can
              > > > set properties for your own application by creating a separate
              > > > properties file. This file can be created and used in two ways:
              > > >
              > > > Put your application-specific properties file in the same directory as
              > > > your weblogic.properties file. You can then use the following code to
              > > > access the properties:
              > > >
              > > > Properties props = new Properties();
              > > > String propertiesName = "myapp.properties";
              > > >
              > > > T3ServicesDef services =
              > > > T3Services.getT3Services();
              > > > String location =
              > > > services.config().getProperty("weblogic.system.home") +
              > > > java.io.File.separator + propertiesName;
              > > > props =
              > > > props.load(new DataInputStream(new FileInputStream(location)));
              > > >
              > > > ****************************
              > > >
              > > >
              > > >
              > > >
              > > > Thanks in advance
              > > > Ravi
              > > >
              >
              

  • Not sure how to configure Weblogic with log4j.xml

    I tried something VERY similar to this. I wasn't sure where to put this code below. I figured in a Servlet environment, it should probably go in a Listener. I found an existing class inside of Spring that does exactly that: org.springframework.web.util.Log4jConfigListener
    I put my log4j configuration file into an entry in the classpath and configured web.xml as follows:
    <!-- Spring log4j parameters -->
            <context-param>
                <param-name>log4jConfigLocation</param-name>
                <param-value>classpath:gov/pa/dep/formu/resources/log4j.properties</param-value>
            </context-param>
            <context-param>
                <param-name>log4jRefreshInterval</param-name>
                <param-value>30000</param-value>
            </context-param>
            <!-- Spring Log4j config listener -->
         <listener>
              <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
         </listener>The server admin placed the actual log4j.properties file into an AppFileOverrides folder instead of under WEB-INF\classes. I don't know if this caused the problem or not. Since I also was using the DailyRollingFileAppender and running into problems LOSING my log entries each day because he file didn't get renamed, I followed Metalink BUG# 8459807, and used the datedFileAppender available at http://minaret.biz/tips/datedFileAppender.html.
    When the application started, the server log showed that log4j was being configured but none of my logging statements were going into the logs. It wasn't until the server admin placed a copy of log4j.properties (a different log4j.properties with a rolling file appender) that the log statements started going into the file that was configured based on web.xml.
    Surely, things can't be this difficult with log4j, and commons logging under WebLogic.
    All I want is APPLICATION LEVEL LOGS that are specific to the day.
    Can someone else elaborate on how they got this working?
    thanks a bunch,
    Eric

    Hi,
    The configuration wizard (config.sh) lets you create a WebLogic Domain, however and depending on others "Oracle Middleware" products installed on the same "Oracle Home" (directory where weblogic has been installed) the configuration wizard allows you create the new weblogic domain to support the others middleware products such as WebCenter.
    When I say support It means that Configuration Wizard allows you to create the weblogic resources like JDBC connections, JMS services, and deploys all applications that integrates another product such as WebCenter.
    I suggest create your domain with support for WebCenter and then from Admin Console create the JDBC resource to connect to other database such as JD Edwards database.
    I hope this help.

  • Is application level logging possible in weblogic server 10.3.3

    Hi,
    I wanted to know whether application logging is possible or not. i.e. customer deploys an application, a log should be created that would contain the name of the application, size of it, timestamp etc.
    Thanks
    Edited by: user10196088 on Mar 24, 2011 6:17 AM

    Hi Yesha,
    Yes, you can do application level logging in weblogic server 10.3.3 using log4j . To get the steps how to do it do have a look at the below link.
    Topic: Log4j At Application Level in WebLogic
    http://middlewaremagic.com/weblogic/?p=633
    Regards,
    Ravish Mody
    http://middlewaremagic.com/weblogic
    Come, Join Us and Experience The Magic…

  • VB Scripting to monitor application event log based on specific words.

    Hi All,
    I Have written, vb script to monitor application event log based on specific word in the message. when I have included same script in monitor, after running this script at specific time once in day, I am getting run time error in the server, where it
    supposed to run, could you please check the command where I have highlighted in below script.
    Dim VarSize
    Dim objMOMAPI
    Dim objBag
    Set objMOMAPI = CreateObject("MOM.ScriptAPI")
    Set objBag = objMOMAPI.CreateTypedPropertyBag(StateDataType)
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Const CONVERT_TO_LOCAL_TIME = True
    Set dtmStartDate = CreateObject("WbemScripting.SWbemDateTime")
    dtmStartDate.SetVarDate dateadd("n", -1440, now)' CONVERT_TO_LOCAL_TIME
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colLoggedEvents = objWMIService.ExecQuery _
     ("SELECT * FROM Win32_NTLogEvent WHERE Logfile = 'Application' AND " _
     & "EventCode = '100'")
    For Each objEvent in colLoggedEvents
    If InStr(LCase(colLoggedEvents.Message), "Message :Application A3 has been successfully processed for today") Then
    X= "Success"
    end if
    Next
    if X="Success" then
    call objBag.AddValue("State","GOOD")
    call objMOMAPI.Return(objBag)
    wscript.quit()
    Else
    call objBag.AddValue("State","BAD")
    call objMOMAPI.Return(objBag)
    wscript.quit()
    End If

    By programming standards since as long as I can remember the use of the value of a variable to detect its Boolean state has been used.
    Cast your mind back to strongly typed languages, e.g. Pascal.
    I'll cast back to the very early days of the "C" language where all variables could be treated as "bool" without a cast. The is no more strongly type language than "C". "C" practically invented the standards for all modern languages. 
    When I was writin machine language we also used zero as false but many machines only  tested the high bit for truthieness.  The HP machines and Intel allowed a test to aggregate to the sign bit.  Adding that flag to the test alloed tru for
    an numeric value that was non-zero.  A boool test was also used for a negative e switch.  If you study micro language implementation you will find that this hardware design and the companion compiler design is ... well... by design.  It is a
    way of improving the completeness and usefulness of an instruction set.
    Other langauges may require further decoration due to some mistaken desire to be better than perfect. That is like trying to change number theory by renaming addition to be "gunking" and forcing everyone to use multiplication when adding the same number
    more than once.  A Boolean test os a test of the flag bit with to without aggregation.    Even if we test a bit in a word we still mask and aggregate.  It is always the most primitive operation.  It is also the most useful
    operation when you finally realize that it is like an identity in math.
    Use the language features that are designed in. They can help to make code much more flexible and logical.
    By the way, Pascal also treats everything as Boolean when asked to.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • Dual external monitor setup?

    I'd like to use dual external monitors, ideally also plus the laptop screen for a total of 3 monitors, with my new 5th gen 17" MBP. I hear that USB-to-DVI options out there due have very poor poor refresh rates and picture quality. I'd like to use th

  • Photo  Aspect Ratio Problems.

    Hi Folks, Am needing some advice from all you oracles out there lol. I use PSE 7, when I print my photos I prefer to use the standard 3:2 ratio (6x4, 7x9, inch for example). When I use my crop tool on Elements 7 the photo ratio is different. Is it po

  • Going back to selection screen from Change mode in ALV.

    Hello Gurus, I am working on a issue related to ALV where ALV becomes editable when user clicks on change button.  The Change button is a custom button defined in application toolbar of ALV display. case ucomm. WHEN 'TBACK'.      leave to screen 0. w

  • Parallel processing using arfc.

    Hi experts, Does any have a presntation on how to proceed with parallel processing with ARFC? Thanks in Advance.

  • Nokia n95 8gig occasssional crashes

    Hi My Nokia n95 8gig Randomly crashes and i have to take out the Battery for it to work again.. very frustratingas i miss out on call's msg's etc thinking phone is on and its actually dead. This usually happens when my phone is idle for a few hours.