Skip to Content
avatar image
Former Member

Question about the use of the logger

I am trying to use the logger but it seems that unless i create a location named: "myview.class", i will not be able to see it? is this correct.

This code is generated automatically:

<b>private static final com.sap.tc.logging.Location logger =

com.sap.tc.logging.Location.getLocation(myView.class);</b>

And i can not change it, so if i dont have the location i can not use it.

<b>logger.errorT("myMessage"); - this will not be seen.</b>

The only way i could see my log messages was if i did this:

com.sap.tc.logging.Location.getLocation("ExistingOldLocation").errorT("mymessage");

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 29, 2004 at 11:48 AM

    Hi Erez,

    You have to create a location like this. E.g. I have class

    com.dbeisert.Hello that has logger.

    public class Hello{

    private static final com.sap.tc.logging.Location logger =

    com.sap.tc.logging.Location.getLocation(Hello.class);

    }

    If you create a location with the name of "com.dbeisert"

    everything in this package and each subpackage will be logged to this location. So just create location with the package prefix of your application and logging will work for each class under this package. It is basically like Log4J.

    rgds

    David

    Add comment
    10|10000 characters needed characters exceeded