cancel
Showing results for 
Search instead for 
Did you mean: 

Logging & Tracing -> Location.getLocation(????????????????)

Former Member
0 Kudos

Hi!

I have a java File *.java which is inside of Developments

src/packages/.......

The problem is now that I would like trace some methods and variables of this class(*.java ).

But I can't use - > wdThis.wdGetIPersonController().getLocation() in the mentioned java File.

What can I use instead of ?

mLocation =

Location.getLocation(????????????????)

The standard usage of Logging at WebDynpro is as follows:

I have to implement a getLocation method:

public com.sap.tc.logging.Location getLocation( )

{

//@@begin getLocation()

mLocation =

Location.getLocation( wdThis.wdGetIPersonController().getLocation(),

"im.IPersonMainView");

return getLocation();

}

return mLocation;

//@@end

}

Accepted Solutions (1)

Accepted Solutions (1)

ThatSAPGuy
Advisor
Advisor
0 Kudos

Sas-

You do not have to create a getLocation() method. When you create a component/view/custom controllers. Each controller has a private Location reference:


  private static final com.sap.tc.logging.Location logger = 
    com.sap.tc.logging.Location.getLocation(TableCompView.class);

Just use this reference logger for all your logging needs. For example:


logger.debugT("The number of rows fetched is " + numRows);

Cheers-

Atul

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Atul

is it really true that I don' t need "getLocation()" method.

But please notice this java class what I'm talking about is not a component/view/custom controller.

It is a java class with some needful functions. It's location is inside of Developments

src/packages/.......

regards

sas

ThatSAPGuy
Advisor
Advisor
0 Kudos

Sas-

If you are not using a standard web dynpro controller you will have to explicitely create your own logger. However you do not have to create a getLocation() method. In your java class create a private attribute of type Location.


private static final com.sap.tc.logging.Location logger = com.sap.tc.logging.Location.getLocation(__YourClassName__.class);

Where __YourClassName__ is the name of your class.

Now you can use this reference logger for all your logging needs as described in my previous post.

Cheers-

Atul