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:

public void debug( String message )
public void info( String message )
public void warn( String message )
public void warn( String message, Throwable t )
public void error( String message )
public void error( String message, Throwable t )
public void fatal( String message )
public void fatal( String message, Throwable t )
public void trace( String message )

where:

Argument                Description
message the message to log.
t 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