cancel
Showing results for 
Search instead for 
Did you mean: 

Where does system out or log statements go in ISA-CRM?

Former Member
0 Kudos

We have added some system out print and log.error statments in a new java class file.

Can anybody tell where does these statements go, I mean to which log file. I was hoping defaultTrace.0.log, but could n't find.

We are using CRM/ISA b2b.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mark,

Check if your class extends IsaCoreBaseAction. Rest seems fine to me, you can either use log.error or log.debug.

Also check if it is creating any new logs at all ( for ISA standard code or your code). If not, something is wrong with your logging.properties file.

Regards,

Vivek

Former Member
0 Kudos

Yes, it extends IsaCoreBaseAction.

Let me explain you how and where I put my class file.Please correct me if Iam wrong.

I created this new package com.x.isa.b2b.businesspartner.action under that added a new file xyz.java and to the compiled class file I placed it manually under web-inf\classes directory with the same package structure.

Now I really doubt if this class has been recognised or not.

Could you please tell me if this is the right procedure or not?

Thanks again for your support Bharat.

Former Member
0 Kudos

From what I understand, xyz.java is a Action class that you wrote. Could you send me the snippet of entry from config.xml where your action mapping for this new Action class is maintained? Are you seeing entries in the log file with the names of Action classes before this new Action and after this new Action?

If it still doesn't work, I will suggest creating a jar of this class file placed in web-inf/classes and adding this jar to web-inf/lib.

However, as I said first check your config.xml entries and the log file entries for action classes before and after your new action.

Hope this helps.

Bharat

Former Member
0 Kudos

Bharat,

It's working.

But only System out statements are getting recorded not the log statements.

I didn't do anything different, just re-deployed the application.

Interesting thing now is web-inf\logs are not changing but the defaultTrace is getting updated.

It was the opposite before.

Sincerely appreciate your support.

Former Member
0 Kudos

you are welcome.

Since you redeployed the application, the log-config entries got overwritten. Set the values to DEBUG from ERROR as mentioned by me in one of the posts above and restart the application. Hopefully you should see the log entries too.

If you are still using log.error please remember that this requires resource keys in ISAResources.properties file.

Enjoy ISA

Thx,

Bharat.

Answers (2)

Answers (2)

Former Member
0 Kudos

Mark,

To enable display of system.out.println in defaultTrace.0.log follow the steps below:

1. Log on to visual administrator.

2. Navigate to server->services->Log Configurator.

3. In the right hand frame click on Locations tab.

4. There should exist entry for System.out.

5. Click on the tab "To advanced mode".

6. Select System-> out in left frame and in the right frame click on New. Add the new Name as System.out.print or System.out.println depending on usage in your code. Select the severity level as All.

7. Save-> restart application -> possibly SAP J2EE to start logging System.out statement.

You can follow the same steps for ISA logs to as long as you want to display them in defaultTrace file. However as mentioned by Vivek, it is much easier to look in the admin URL.

Sometimes when you are using WebAS 6.40 System.out.println statements can be viewed using the approach I mentioned above since WebAS 6.40 doesn't run in a console mode.

Thx,

Bharat.

Former Member
0 Kudos

Thanks Vivek and Bharat.

I did the same as Bharat has explained.

Yet I don't see any system out messages in default trace file.

I have also included some log messages(IsaLocation log) but could not see in isaerror log files.

I even went to http://localhost:50000/mycompanyb2b/admin/

and none of the log files contain the log messages I wrote in the new class.

Iam sure the new class is been invoked.

Kindly help me resolve this issue.

Former Member
0 Kudos

Mark,

Try this.

1. http://localhost:50000/mycompanyb2b/admin/

2. Go to logging->view/edit log config

3. In the text area you can see the log-config entries.

4. search for com.sapmarkets.isa.severity.

5. change its value from ERROR to DEBUG.

6. search for log[isa].severity

7. change its value from ERROR to DEBUG.

8. click on apply changes and OK.

9. restart the J2EE ( ideally shdn't be needed but just in case).

This should enable display of your messages in the isa.log file and defaulttrace.log if you are using log.debug statements or log.error statements in your code. I am thinking about the possibility of you expecting an error to be thrown when none is thrown in fact. A log.debug statement is useful in such scenarios.

If this doesn't work too ( can happen sometimes with SAP J2EE :)..probably will be best to try session tracing.

Let me know if you want to know how to use session tracing and/or above doesn't work.

Thx,

Bharat.

Former Member
0 Kudos

Bharat,

I tried it before too.

It did not work.

Could you explain me about the session tracing please?

Former Member
0 Kudos

Mark,

Here the steps for session trace:

1. logon to the XCM administrator

http://mycompnay.com:50000/b2b/admin/xcm/init.do

2. Go to General Settings->Customer->b2b->b2bconfig.

3. In the right side frame select true as the value of the parameter logfiledownload.

4. open URL http://mycompnay.com:50000/b2b/admin

5. Click on logging - > session tracing

6. you will see a partial URL in the next jsp page inside a text field. complete this URL for eg.

http://mycompnay.com:50000/b2b/b2b/init.do

7. Click start application. This will bring up the logon page in a separate browser window.

8. In the previous window click Start Session Tracing.

This will create two hyperlinks with a long name begining with session appended by the date and session ID.

9. Move to the new window where logon.jsp was started and execute whatever steps necessary in the B2B application till you execute the code segments containing your log entries.

10. Come back to the previous window and click on the hyperlink for the logfile under the caption "download"

This will open the session log file as a zip -> text document and you can search for your log entries there.

Thx,

Bharat.

Former Member
0 Kudos

This is how the code looks:

<i>

public ActionForward isaPerform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, UserSessionData userSessionData, RequestParser requestParser, BusinessObjectManager bom,

IsaLocation log)

throws CommunicationException

{

log.error("Z_ResellerSearchAction.isaPerform method.Log info");

System.out.println("Z_ResellerSearchAction.isaPerform method.");

</i>

Do you think the log Iam using is right?

Former Member
0 Kudos

Mark,

don't use log.error instead use log.debug. log.error expects a resource key as parameter so you must define one in ISAResource.properties.

with log.debug you can use the debug message directly instead of the resource key.

details you can find in the ISA Development and Extension Guide at service marketplace alias instguides.

Bharat

Former Member
0 Kudos

Bharat,

Sorry to say that it is still not working.

Are we missing something??

Is there any other way to check the log statements??

Former Member
0 Kudos

Hello Mark,

There are two things:

1) System.out messages: They appear only on console. In case you are using 640, they will not appear to you and in case you are using 620, starts the J2EE engine using command prompt.

2) log.error messages: Appear in the standard isaerror.log files. In case you need to access them, go to http://<host>:<port>/b2b/admin and then click on Logging. On the top you will see link for viewing Log files.

Regards

Vivek