Skip to content

Logging a message

This API logs a message and or error to the server. If the log buffer is configured, the message is stored in it for subsequent flush, otherwise, the log message is delivered to the server.All methods are available on the logger object retrieved using the method described above:

Future<void> debug(String message)
Future<void> info(String message)
Future<void> warn(String message, [Exception e])
Future<void> error(String message, [Exception e])
Future<void> fatal(String message, [Exception e])
Future<void> trace(String message)

where:

Argument                Description
message the message to log.
e an exception or error to log. Backendless logs a stack trace for the exception.

Example

Logger logger = Backendless.logging.getLogger("com.mbaas.Logger");
logger.info("Starting application..");

Once the example runs, the Manage > Log Management screen in the Backendless Console will show the following:
log-file-sample.zoom50