-
Notifications
You must be signed in to change notification settings - Fork 29
Logging
Juanito Fatas edited this page Jun 1, 2022
·
14 revisions
Buildkite::TestCollector uses a custom logger that prints process and thread information in the logs to help with debug:
# UTC Timestamp -------------- Process - Thread - Message
2022-05-23T05:37:06.002995000Z pid=27241 tid=7060 DEBUG: added 12345678-1234-1234-1234-123456781234 to send queue
-
pid:Process.pid -
tid:Thread.current.object_id
Buildkite::TestCollector uses Ruby’s Logger library and log level defaults to Logger::WARN and logs to $stderr.
If you want to turn on debugging for Buildkite::TestCollector, you can change the log level to Logger::DEBUG by:
- Set
BUILDKITE_ANALYTICS_DEBUG_ENABLEDenvironment variable to any value - Set
$DEBUGflag to a truthy value - Change the log level of
Buildkite::TestCollector.loggerBuildkite::TestCollector.logger.level = ::Logger::DEBUG
Buildkite::TestCollector.logger = Buildkite::TestCollector::Logger.new("log/buildkite-analytics-collector.log")Additionally, add artifacts_path to your pipeline configuration to make the log available as a Build artifact, learn more about using Buildkite artifacts.
To silent Buildkite::TestCollector logging in your test environment, set the log level to ERROR or FATAL:
Buildkite::TestCollector.logger.level = Logger::ERRORSimply send the logs to /dev/null:
Buildkite::TestCollector.logger = Buildkite::TestCollector::Logger.new("/dev/null")