mirror of
https://github.com/postalserver/postal.git
synced 2026-10-18 18:26:06 +00:00
Compare commits
3
Commits
3.3.7
...
b2cad51a28
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2cad51a28 | ||
|
|
ced77a3860 | ||
|
|
3be663dc89 |
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "3.3.7"
|
||||
".": "3.4.0"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
This file contains all the latest changes and updates to Postal.
|
||||
|
||||
## [3.4.0](https://github.com/postalserver/postal/compare/3.3.7...3.4.0) (2026-09-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add configurable Postal logger level defaulting to INFO ([#3626](https://github.com/postalserver/postal/issues/3626)) ([ced77a3](https://github.com/postalserver/postal/commit/ced77a3860c23779889aec8dacd2642f20d10cea))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* give each worker process a unique locker identity ([#3628](https://github.com/postalserver/postal/issues/3628)) ([3be663d](https://github.com/postalserver/postal/commit/3be663dc8931bd731516bafd6edff6b0fbd03df2))
|
||||
|
||||
## [3.3.7](https://github.com/postalserver/postal/compare/3.3.6...3.3.7) (2026-06-03)
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ This document contains all the environment variables which are available for thi
|
||||
| `LOGGING_RAILS_LOG_ENABLED` | Boolean | Enable the default Rails logger | false |
|
||||
| `LOGGING_SENTRY_DSN` | String | A DSN which should be used to report exceptions to Sentry | |
|
||||
| `LOGGING_ENABLED` | Boolean | Enable the Postal logger to log to STDOUT | true |
|
||||
| `LOGGING_LEVEL` | String | The minimum log level for the Postal logger (debug, info, warn, error, fatal) | INFO |
|
||||
| `LOGGING_HIGHLIGHTING_ENABLED` | Boolean | Enable highlighting of log lines | false |
|
||||
| `GELF_HOST` | String | GELF-capable host to send logs to | |
|
||||
| `GELF_PORT` | Integer | GELF port to send logs to | 12201 |
|
||||
|
||||
@@ -89,6 +89,8 @@ logging:
|
||||
sentry_dsn:
|
||||
# Enable the Postal logger to log to STDOUT
|
||||
enabled: true
|
||||
# The minimum log level for the Postal logger (debug, info, warn, error, fatal)
|
||||
level: INFO
|
||||
# Enable highlighting of log lines
|
||||
highlighting_enabled: false
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ require "konfig/sources/environment"
|
||||
require "konfig/sources/yaml"
|
||||
require "dotenv"
|
||||
require "klogger"
|
||||
require "securerandom"
|
||||
|
||||
require_relative "error"
|
||||
require_relative "config_schema"
|
||||
@@ -82,16 +83,21 @@ module Postal
|
||||
def logger
|
||||
@logger ||= begin
|
||||
k = Klogger.new(nil, destination: Config.logging.enabled? ? $stdout : "/dev/null", highlight: Config.logging.highlighting_enabled?)
|
||||
k.level = Config.logging.level
|
||||
k.add_destination(graylog_logging_destination) if Config.gelf.host.present?
|
||||
k
|
||||
end
|
||||
end
|
||||
|
||||
def process_identity
|
||||
@process_identity ||= SecureRandom.hex(8)
|
||||
end
|
||||
|
||||
def process_name
|
||||
@process_name ||= begin
|
||||
"host:#{Socket.gethostname} pid:#{Process.pid}"
|
||||
"host:#{Socket.gethostname} pid:#{Process.pid} id:#{process_identity}"
|
||||
rescue StandardError
|
||||
"pid:#{Process.pid}"
|
||||
"pid:#{Process.pid} id:#{process_identity}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -227,6 +227,19 @@ module Postal
|
||||
default true
|
||||
end
|
||||
|
||||
string :level do
|
||||
description "The minimum log level for the Postal logger (debug, info, warn, error, fatal)"
|
||||
default "INFO"
|
||||
transform do |value|
|
||||
normalized = value.to_s.strip.downcase
|
||||
normalized = "info" if normalized.empty?
|
||||
unless %w[debug info warn error fatal].include?(normalized)
|
||||
raise ArgumentError, "logging.level must be one of: debug, info, warn, error, fatal (got #{value.inspect})"
|
||||
end
|
||||
normalized
|
||||
end
|
||||
end
|
||||
|
||||
boolean :highlighting_enabled do
|
||||
description "Enable highlighting of log lines"
|
||||
default false
|
||||
|
||||
Reference in New Issue
Block a user