-
Notifications
You must be signed in to change notification settings - Fork 5
Specifying Logger Configuration
You can specify a custom logger configuration using a configuration file.
✋ Note: | A custom logger configuration can only be specified using a configuration file. See Using a Configuration File for more details. |
---|
The logger configuration is specified in the configuration file using the logger_config object. For more information about the logger configuration, see Configuration dictionary schema in the Python documentation.
Any custom logger configuration must at least define stdout and rotating_service_logfile handlers as well as configure testflows.github.hetzner.runners in the loggers.
For example,
config.yaml: |
config:
# logging module config
logger_config:
version: 1
disable_existing_loggers: false
formatters:
standard:
format: "%(asctime)s %(levelname)s %(funcName)s %(message)s"
datefmt: "%m/%d/%Y %I:%M:%S %p"
handlers:
stdout:
level: INFO
formatter: standard
class: testflows.github.hetzner.runners.logger.StdoutHandler
stream: "ext://sys.stdout"
rotating_service_logfile:
level: DEBUG
formatter: standard
class: testflows.github.hetzner.runners.logger.RotatingFileHandler
filename: /tmp/github-hetzner-runners.log
maxBytes: 10485760
backupCount: 1
loggers:
testflows.github.hetzner.runners:
level: INFO
handlers:
- stdout
- rotating_service_logfile |
---|
If the logger configuration is using a custom format for the rotating_service_logfile, then a custom logger_format object must be defined to specify the format of the service's rotating log file, which is needed for the service log and cloud log commands.
For the example above, the custom logger_format is the following:
config:
# logger format
logger_format:
delimiter: " "
default:
- column: date
- column: time
- column: time_ampm
- column: level
- column: funcName
- column: message
columns:
- column: date
index: 0
width: 10
- column: time
index: 1
width: 8
- column: time_ampm
index: 2
width: 2
- column: level
index: 3
width: 8
- column: funcName
index: 4
width: 15
- column: message
index: 5
width: 80
Note that the date, time, and time_ampm columns come from the datefmt definition, which defines the asctime as a three-column field consisting of date, time, and time_ampm columns separated by a space.
datefmt: "%m/%d/%Y %I:%M:%S %p"
Developed and maintained by the TestFlows team.
- Home
- Installation
- Quick Start
- Getting Started Tutorial
- Basic Configuration
- Specifying the Maximum Number of Runners
- Specifying the Maximum Number of Runners Used in Workflow a Run
- Recycling Powered‐Off Servers
- Skipping Jobs
- Using Custom Label Prefix
- Jobs That Require the Docker Engine
- Specifying The Runner Type
- Specifying The Runner Location
- Specifying The Runner Image
- Specifying The Custom Runner Server Setup Script
- Specifying The Custom Runner Server Startup Script
- Disabling Setup or Startup Scripts
- Specifying Standby Runners
- Specifying Logger Configuration
- Listing All Current Servers
- Opening The SSH Client To The Server
- Deleting All Runners and Their Servers
- Using a Configuration File
- Specifying SSH Key
- Specifying Additional SSH Keys
- Running as a Service
- Running as a Cloud Service
- Scaling Up Runners
- Scaling Down Runners
- Handling Failing Conditions
- Meta Labels
- Estimating Costs
- Listing Images
- Deleting Images
- Creating Custom Images
- Program Options