1

I would like to log the Worklight server log in adapters. I have turned "audit" = true in adapter XML and used WL.Logger.log("Here is my log") to test the logging.

In WebSphere\AppServer\profiles\AppSrv01\logs\server1\SystemOut.log, I can see the following log:

[2013/8/3   21:36:28:581 CST] 000000bb JavaScriptInt I   com.worklight.integration.js.JavaScriptIntegrationLibraryImplementation log Here is my log
[2013/8/3   21:36:31:225 CST] 0000006b AuditBean     I  audit User 'Unknown' invoked procedure 'Adapter.getData' with parameters {
   "arr": [
   ]
}

My question is that:

(1) Can I create a log file which only logs these Worklight server log? Is there any log4j.properties in Worklight which I can set this info? I have searched around the information center and it tells me to reference to Websphere application server logging. But I believe I shall configure this in Worklight?

(2) Can Worklight server HTTP session can be logged as well?

Many thanks.

Environment: Worklight 5.0.6.1, WAS ND 8.5

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
red23jordan
  • 2,841
  • 10
  • 41
  • 57

1 Answers1

0
  1. Starting Worklight 5.0.5, Worklight no longer uses Log4j, rather JUL (Java Util Logging) is used. This means that you have to do it in the tools of the application server that you use.

    I've found the following: Adding custom handlers, filters, and formatters.
    Perhaps what you can do in WAS is to add the above and filter com.worklight.

  2. I do not fully understand this, can you elaborate? Until then,
    Try to use a 3rd party application such as Wireshark.

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • Thanks. For #1, I will try to look it into details. For #2, what I mean is that I would like to log the HTTP session for the request to Worklight server as well. For example, when a user invokes "TestAdapter", it is actually making a request to Worklight server through http request. Is it possible to log the HTTP session as well? – red23jordan Aug 04 '13 at 18:15
  • By the way I have Java classes and I want to know if I can put logging inside these classes. I've found this but I guess it's not the way to do it WorklightServerLogger logger = new WorklightServerLogger(CustomLdapLoginModule.class, MessagesBundles.EXTENSION_API); – Houcem Berrayana Sep 30 '13 at 06:35
  • @HoucemBerrayana, this does not belong to this question. Try the following: http://stackoverflow.com/questions/16947323/worklight-5-0-6-1-system-out-println-logging-from-worklight-adapter-is-not-w – Idan Adar Sep 30 '13 at 06:38