Administration/Configuration Files

Logger Configuration

Configure the logging system for your Gigantics instance, including log levels and output formats.

Configuration Properties

The logger configuration can be set in your config/default.yaml file:

logger:
  level: 'http'
  output: 'dev'

Property Details

level

  • Type: String
  • Default: 'silly' in development, 'http' in production, 'test' in test environment
  • Description: Controls the verbosity of log output. Available levels (in order of verbosity):
    • error - Only errors
    • warn - Errors and warnings
    • info - Errors, warnings, and info messages
    • http - HTTP request logging and above
    • verbose - Detailed information
    • debug - Debugging information
    • silly - Everything including silly messages

output

  • Type: String
  • Default: 'dev'
  • Description: Controls the log output format.
    • 'dev' - Colored, human-readable format for development
    • Other formats can be specified as needed

Examples

Development Logging

logger:
  level: 'silly'
  output: 'dev'

Production Logging

logger:
  level: 'info'
  output: 'dev'

Minimal Logging

logger:
  level: 'error'
  output: 'dev'

Verbose HTTP Logging

logger:
  level: 'http'
  output: 'dev'

Environment-Based Defaults

The application automatically sets different log levels based on the environment:

  • Development: silly level for maximum detail
  • Production: http level for HTTP request logging
  • Test: test level for testing environment

You can check your environment with:

echo $NODE_ENV

Command Line Override

You can override the log level using the command line:

# Set log level to debug
./gig start --logLevel=debug
 
# Set log level to verbose
./gig start --logLevel=verbose

Available Log Levels

LevelDescription
errorOnly critical errors
warnErrors and warnings
infoGeneral information messages
httpHTTP request/response logging
verboseMore detailed information
debugDebugging information
sillyEverything including silly messages

Best Practices

  1. Production: Use http or info levels to avoid excessive log volume
  2. Development: Use silly or debug levels for detailed troubleshooting
  3. Monitoring: Ensure logs are properly rotated and stored
  4. Security: Be careful about logging sensitive information
  5. Performance: Lower log levels can improve performance in high-traffic environments

Testing Configuration Changes

After modifying logger configuration:

  1. Restart the application:

    ./gig stop
    ./gig start
  2. Perform some actions in the application to generate log entries

  3. Check the log file specified in the logs configuration to verify the new log level is active

On this page