cancel
Showing results for 
Search instead for 
Did you mean: 

Question about the use of the logger

Former Member
0 Kudos

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");

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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