Watchdogs

FlexLogs Docs Image

Watchdogs keep an eye out for FlexLogs "watchdog" tags in your logs to ensure everything is running smoothly. Think of them as vigilant guards, always ready to alert you if something goes awry.

Every application has critical processes that need constant monitoring. Watchdogs make this easy watching for Watchdog checkins in your logs. When a watchdog log entry shows up, the Watchdog knows everything is fine. But if it doesn’t show up in time, you’ll get notified.

Setting up a Watchdog is easy. Add the FlexLogs watchdog checkin to what you need to monitor, and let the Watchdog handle the rest. Watchdogs are good for tasks such as checking if a daily backup completed successfully or ensuring a batch job ran on time.

Quickstart

    
      
    // An example of creating a watchdog (checking in is the same)
    logger.info("flexlogs{watchdog: 'watchdog-name'}");
    // Send this log entry at regular intervals to keep the watchdog happy
  
    
  

Options

Key Description Type / Options Default
watchdog Name for your Watchdog String
interval The initial interval for the Watchdog Number (in seconds) 3600 (1 hour)
tags List of tags Array []

Examples

    
      
    // Add an intial checkin interval in seconds
    logger.info("flexlogs{watchdog: 'watchdoggy', interval: 600}"); // 10 minutes

    // Add some tags
    logger.info("flexlogs{watchdog: 'watchdawg', tags: ['tag1', 'tag2']}");