OpenWGA 7.10 - TMLScript reference

WGA
Object:

WGA.Logger(name)

Description

Returns a WGALogger utility object for the given name.

The WGALogger object has two methods:

  • getLogger()
    returns the Log4J Logger for the given name prefixed by "wga.". The Logger is created if not already exists.
  • setLevel(level)
    sets the log level for the specified Logger. Allowed level names are "info", "debug", "warn" and "error".

The default log level of all loggers is "info". To log debug messages either call setLevel("debug") somewhere in your code or in TMLScript console of the admin Client or start your runtime with System-Option

-Dde.innovationgate.wga.debug=wga.<your-logger-name>

Allowed in script types
  • WebTML pages and normal WebTML actions
  • Master actions
  • TMLScript tasks in jobs
  • Content type events
Properties and methods See above.
Examples
var log = WGA.Logger("my-logger").getLogger();
log.info("some info message");
log.debug("some debug message");

Because the default log level is "info" the debug message will not appear in the console output until you call 

WGA.Logger("my-logger").setLevel("debug")