Log.apex

  • Docs
  • Tutorials
Docs Menu
  • Logger
  • Configuration
    • Configuration File
    • Configure Logging
  • Appenders
    • Default Appenders
    • Custom Appenders
    • Async Logging
    • Default Async Appenders
    • Custom Async Appenders

Async Logging Guide

Async Logging

Async Logging

Log.apex implements async logging by buffering all logging requests into a queue, and flush the queue in a queueable job to finally complete the logging.

Therefore, a very important thing is that you are forced to call flush at the end of the execution context. Otherwise, all the buffered logging requests are discarded.

logger.debug('message');

// ...

Log.flush();

Usually you put Log.flush() at the end of remote action calls, visualforce page controller actions, web service actions and so on.

Contribute on Github! Edit this section.