facebook

How MyEclipse Jboss console Log4J output

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #239091 Reply

    Hi All,

    I have MyEclipse 4.0.1GA with Eclipse 3.1.1 installed.

    I have configured the JBoss 4 plugin with JBoss 4.0.1sp1 server with exploded EAR deployment containing a EJB and Web modules. I also have Log4J configured the Web module and can see it’s Log4J output if I ‘tail’ the server.log but not in the MyEclipse JBoss console!

    How do I get the Log4J output of the Web module to show up in the MyEclipse JBoss console?

    -Sandeep Khanna

    #239157 Reply

    Riyad Kalla
    Member

    I also have Log4J configured the Web module

    Please explain how you have Log4J configured. If you have a log4j.properties file, what are the parameters you have set in it? MyEclipse will intercept standard server output, if you are redirecting this using a specific log4j file, try and remove it from your project’s classpath and restart/redpeloy your project and see if that helps.

    #239269 Reply

    I have a log4j.properties file in the source folder for the Web project with the following contents.

    # Set root category priority to DEBUG and set its only appender to Console
    log4j.root=ERROR, Console
    log4j.com.adminserver.uip.CycleActionUip=DEBUG, Console
    log4j.com.adminserver.uip.CycleFormUip=DEBUG, Console

    # Console is set to be a ConsoleAppender (writes to system console).
    log4j.appender.Console=org.apache.log4j.ConsoleAppender

    # Console uses PatternLayout.
    log4j.appender.Console.layout=org.apache.log4j.PatternLayout
    log4j.appender.Console.layout.ConversionPattern=[%5p]: (%C{1}.%M:%L) – %m%n

    # dynamic log reader “Chainsaw”
    # connects to chainsaw reader which must be running separately
    # ex) java -classpath [path]/log4j.jar org.apache.log4j.chainsaw.Main
    log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
    log4j.appender.Chainsaw.remoteHost=localhost
    log4j.appender.Chainsaw.port=4445
    log4j.appender.Chainsaw.locationInfo=true

    After rebuilding & redeploying the Enterprise App (EJB + Web), I can see the web application’s Log4J output in the JBoss server’s server.log file but not in the MyEclipse JBoss console.

    #239278 Reply

    Riyad Kalla
    Member

    If you remove the file from your classpath, is the output correctly sent ot he MYEclipse console?

    #239280 Reply

    As per your suggestion, I removed the log4j.properties file from the source folder. This also removed it from the classes folder. And redployed the EAR application. Confirmed in the JBoss deploy/<App-Name> folder that was no log4j.properties in the WEB-INF/classes folder of the webapp.

    Ran the same code. MyEclipse IDE JBoss console still does not show any of the Log4J output but on the gnome-terminal console with “tail -f server.log” I see the following…

    2005-10-12 17:44:48,610 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.deployment:type=DeploymentScanner,flavor=URL dependent components: []
    2005-10-12 17:44:48,745 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: jboss-service.xml
    2005-10-12 17:44:48,745 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/home/sandeepk/apps/jboss-4.0.1sp1/server/default/conf/jboss-service.xml
    2005-10-12 17:44:48,747 DEBUG [org.jboss.web.tomcat.tc5.Tomcat5] Saw org.jboss.system.server.started notification, starting connectors
    2005-10-12 17:44:48,898 INFO [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
    2005-10-12 17:44:49,262 INFO [org.apache.jk.common.ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
    2005-10-12 17:44:49,272 INFO [org.apache.jk.server.JkMain] Jk running ID=0 time=0/52 config=null
    2005-10-12 17:44:49,341 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)] Started in 50s:104ms
    2005-10-12 17:44:52,573 DEBUG [com.adminserver.uip.CycleFormUip] In ActionForm class
    2005-10-12 17:44:57,247 DEBUG [com.adminserver.uip.CycleActionUip] In Action class

    As you can see, I can see the Log4J output directly in the server.log but *not* in MyEclipseIDE JBoss console.

    In case I didn’t mention this earlier, I am running JBoss 4.0.1sp1 in debug mode through MyEclipseIDE.

    #239288 Reply

    Riyad Kalla
    Member

    This is very strange, I will ask someone to look in on this.

    #239290 Reply

    Riyad Kalla
    Member

    After discussing this with one of the developers, we’d like you to try and download JBoss 4.0.2, and deploy your project (without the log4j property file at first) and see if it works. Then add the proeprty file back, and redeploy it. Does it still work?

    #239831 Reply

    Hi,

    I tried with 4.0.2 & also with the latest 4.0.3 but the Log4J logger.debug(“Testing Log4J output in MyEclipse JBoss console window”); does not work!

    Altough, I can see that in the server/default/log/server.log file.

    Any suggestions?

    #239836 Reply

    Riyad Kalla
    Member

    When you run JBoss from the console, do you see the output in the JBoss console (not the log file, but the console).

    The Console view is hooked into the app server’s standard out and standard err streams, if you have your app server setup to log directly to files or the like, then there is nothing ME can do to avoid that.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: How MyEclipse Jboss console Log4J output

You must be logged in to post in the forum log in