Logging

There are a number of different log files available. They cover different parts of the system, so it is good to know which file to check, if you have a problem you need to investigate.

  • sdk.log: This is the file where any logging done in your jsp or java code ends up. The built-in functions that are available through the tags will also log to this file. This log will not contain any messages unless you actively write to it. The file can be up to 20Mb and we keep the last 50 files.
  • catalina.log: The server logs to this file when errors occur, so if you have compile errors on your jsp page or have uncaught exceptions in you jsp page (the errors that you typically see in the webpage). The system generates one file per day, which can be of arbitrary size.
  • access.log: System generated file which shows all request to the apps or global modules. The system generates one file per day, which can be of arbitrary size.
  • Js extension log: standard logging setup so info, warn, error with a message.

Accessing log files

There are two ways of getting access to the log files:

Webdav https://<servername>/api/logs/logs (use your agillicadmin credentials). This will list all the log files available.

https://<servername>/bcmportlet/developer/developer/showlogs – will show the last 50 messages logged to the sdk and catalina logs.

SDK log

The sdk.log is the file that you can log to yourself. It can be used to log any information you find useful for debugging or investigating your code either during development or after it has gone live. Except for the functions you can call through using the tag in the tag library no other code than your own will log to this file.

The logging is done using log4j.

The logger accessible in a jsp page, is created with the name SDK.apps. I.e. the file webapps/apps/mysignup/index.jsp will have a logger called SDK.apps.mysignup.index

If you are uploading precompiled java classes and wish to use log4j, you will have to prefix you logger names with SDK to be able to see the output – i.e.

private static final Logger log = LoggerFactory.getLogger("SDK." + YourClassHere.class.getName());

JSP page log

You can use one of two methods:

  1. Using the <sdk:log message='...'/> tag
  2. Using the jsplog.debug("….") method

The jsplog is automatically available with <sdk:action> and <sdk:render> blocks.

Examples:

Catalina log

The catalina log is generated automatically by the server and it will contain messages generated by the global or apps modules. Where the sdk.log will contain any messages you have logged yourself the catalina log primarily contains of unhandled issues – which most likely was also shown on the webpage. The most likely cause of such an issue is:

  • Compile errors: A jsp page contained syntactical errors and could not compile
  • Uncaught exceptions: Any exception thrown on the jsp page but not caught on the jsp page will appear here.

In addition to those there will also be a bit of “server book keeping” in this file. So any time the server is restarted one or two lines will appear, similar if the apps module is reloaded as part of a publish it will appear in this file.

The catalina log is generated per day, and contains the date in the name of the file.

Access log

The access log allows you to see remote calls to any jsp page in apps or global. This can be cases where you want to expose your own remote APIs or if you make ajax calls to load data in your portlet.

The access log only contains direct calls to the apps or global modules, i.e the following calls will not be logged:

  • SDK portlets loading the page for render or action requests.
  • Any page which is access using forwards or includes (either using url’s such as /web/forward/apps/mypage.jsp or programmatically including on a jsp page).

The access log is generated per day and contains the date in the name of the file.

JS Extension Log

Please see the section on logger for JS Extension.