Logging
ORM::ActiveRecord uses Log::Async
under the hood. Loading the library configures the INFO-level handler to
write to $*OUT (stdout). That's the only log destination set up by default
— loading the library does not touch the filesystem.
File logging
Set ORM_LOG_FILE in the process environment to an absolute or relative path,
and ERROR-level messages will be appended to that file:
1 | |
1 2 | |
Notes:
- The path is resolved against the current working directory at the time
the library is loaded. If the directory doesn't exist, opening the file
will fail — create it first (
mkdir log) or use an absolute path. - The variable is read once, when
ORM::ActiveRecord::Support::Logis first loaded. Setting it after that point has no effect on the current process. - Unset or empty
ORM_LOG_FILE⇒ no file handler is attached. This keeps the library safe to load under tooling that runs from arbitrary working directories (LSP precompilation, CI matrices, cron jobs). - The
bin/armigration CLI defaultsORM_LOG_FILEtolog/error.log— but only when alog/directory exists in the current working directory. So runningarfrom the project root keeps the old file-logging behavior, while precompilation under tooling that runs from elsewhere (LSP, CI checkout from a parent dir, etc.) skips it cleanly. Export a different value before invokingarto override.
Disabling SQL logging
Adapters emit each query at INFO level. To silence them, set:
1 | |
This is typically what you want under test suites — t/ already sets it
where appropriate.