Developers

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.

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:

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:

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.