Skip to Content
author's profile photo Former Member
Former Member

println, printStackTrace output in an EJB... Where is it going?

I'm not making much progress in debugging an EJB application because System.out.println doesn't show in the console, and neither does printStackTrace. Even if I type 'throw new Exception("look at this")' in code that I know runs, I don't see "look at this" anywhere in the console output. And when I tried to debug, I see some $Proxy class, and it says it has no source code for that (but I know it's my bean code that it's running).

So that's my saga for the last hour. How am I SUPPOSED to be getting feedback on the running of my beans? Is there an example of logging or something that I should be looking at?

By the way, I've found my way into the j2ee admin and the log configuration, and I may need help with that later. But for now, how is one supposed to create entries in those logs?


I have tried:

Logger.getLogger("UserSession").log(Level.ALL, "testing
 the logger user session");

but that results in a failed deployment because of some credentials problem. So I tried:

Logger.getLogger("AppTracing").log(Level.ALL, "testing 
the logger app tracing");

and that resulted in a deployment, and the method with this line runs, but there is no file on my machine matching *.trc with a current time stamp. By the way, "AppTracing" is one of the defined log controllers, and I tried both a green dot and a blue dot in the engine admin console. It's linked to service_apptracing_log_invocations, so the file is supposed to be called ./log/system/performance/apptracing_invocations.log. I don't know what the root (.) is, so I searched the whole drive for *.log, but nothing turned-up.

Ideas? Does anyone have a log or trace that actually works?


Message was edited by: Dale Seng

Message was edited by: Dale Seng

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • Posted on Jul 05, 2004 at 01:44 PM

    How about using NDev Studios built in debugging capabilities? I just linked there in a post before:

    That shows you how to do it.

    If you really need to look into logs, you should use logviewer, availbale from Visual Administrator or in it's standalone version.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Benny. I've been able to run the debug from the tutorial. And in fact my first thought (ahead of log files) was to use the debug. I set a breakpoint in my EJB, and it ran and stopped at the breakpoint. Everything sounds great so far, but the problem was it was running some derived class ($Proxy) that apparently had no source code (at least it didn't show for me, as I have it configured).

      Then I tried to figure-out logging. I looked through the help files, but wasn't able to make the connection between what to put into the code, and what to do in the visual admin. I could see some things in the logviewer, just nothing that I was trying to write.

      So for now I'm just writing to a file... until I figure out debugging or logging.


  • author's profile photo Former Member
    Former Member
    Posted on Jul 06, 2004 at 08:26 PM

    I also have similar problems using Logging with SAP Netweaver. So far I could write to a file and to the console by using the class "" or "".

    SAP suggests to use Location for trace mesages and the Category for distinguished problem areas such as networking, ...

    Add the jars (loggingStandard.jar, logging.jar)from folder "\JDT\eclipse\plugins\\lib" to the build path of your project

    Then try this coding:

    private static final Location loc = Location.getLocation("com.vendor.package.ClassName");


    loc.addLog(new ConsoleLog()); //for logging on the console

    loc.addLog( new FileLog("D:
    testOutput.log")); //for logging in a file

    String method = "method_name";

    String msg = "message";





    There is also the posibilty to configure the Logging in the file log-configuration.xml of an EAR project.

    Thats probably is the correct way to use it. Unfortunately I dont have any examples for that. At the moment I am playing around to find the right way to use the SAP Logging.

    Best Regards,


    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 06, 2004 at 08:37 PM

    Have a look on this page for further information about the SAP Logging API.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Benny Schaich-Lebek

      Thanks Benny, for the follow-up. I finally gave up and started appending messages to a FileWriter. And at the moment I'm not doing development work on the platform. But I think this is one area where we are in need of a cookbook; there's configuration, enabling, and using specific classes in specific ways, and all of this needs to be coordinated. If I spent a long while with the help text, I might be able to get it, but it would be more efficient to see an example.