Logging
You can customize the logger with:
.ufo/config.rb
Ufo.configure do |config|
config.logger.level = "debug"
end
Custom Logger
The default logger logs to $stderr
. To use a custom logger that logs to $stdout
.
Ufo.configure do |config|
logger = Logger.new($stdout)
logger.level = "debug"
config.logger = logger
end
For a list of available config settings, refer to the Config Reference docs.
Environment Specific Overrides
You can configure environment specific value overrides for .ufo/config
with corresponding .ufo/config/env/UFO_ENV.rb
files. Examples:
.ufo/config/env/dev.rb
Ufo.configure do |config|
config.logger.level = "debug"
end
.ufo/config/env/prod.rb
Ufo.configure do |config|
config.logger.level = "info"
end
Reference
The table below covers each setting. Each option is configured in .ufo/config.rb
with config.OPTION
. The config.
portion is not shown for conciseness. IE: logger.level
vs config.logger.level
.
Name | Default | Description |
---|---|---|
log.root | The root folder where logs are written to. | log |
logger | Logger instance to use. | Logger.new($stderr) |
logger.formatter | Logger Formatter to use. See Formatter for interface. | UFO::Logger::Formatter |
logger.level | Can also be set with UFO_LOG_LEVEL env var |
info |
logs.filter_pattern | nil | Default filter pattern to use. The CLI option overrides this setting. Example: config.logs.filter_pattern = '- "HealthChecker"' . Note the - minus sign rejects patterns. See: AWS Docs: CloudWatch Logs Filter and Syntax Pattern. |