Class: Gitlab::JsonLogger
- Inherits:
-
Labkit::Logging::JsonLogger
- Object
- Labkit::Logging::JsonLogger
- Gitlab::JsonLogger
show all
- Defined in:
- lib/gitlab/json_logger.rb
Direct Known Subclasses
ClickHouse::Logger, Feature::Logger, AppJsonLogger, AuditJsonLogger, AuthLogger, BackgroundMigration::Logger, BackupLogger, Ci::ResourceGroups::Logger, Database::HealthStatus::Logger, Database::LoadBalancing::Logger, DeprecationJsonLogger, Elasticsearch::Logger, ErrorTracking::Logger, Export::Logger, GitLogger, GraphqlLogger, Import::Logger, IntegrationsLogger, Kubernetes::Logger, PerformanceBar::Logger, RedactedSearchResultsLogger, Services::Logger, WebHooks::Logger
Class Method Summary
collapse
Class Method Details
.build ⇒ Object
31
32
33
34
|
# File 'lib/gitlab/json_logger.rb', line 31
def build
Gitlab::SafeRequestStore[cache_key] ||=
new(full_log_path, level: log_level)
end
|
.cache_key ⇒ Object
36
37
38
|
# File 'lib/gitlab/json_logger.rb', line 36
def cache_key
"logger:" + full_log_path.to_s
end
|
.debug(message) ⇒ Object
15
16
17
|
# File 'lib/gitlab/json_logger.rb', line 15
def debug(message)
build.debug(message)
end
|
.error(message) ⇒ Object
19
20
21
|
# File 'lib/gitlab/json_logger.rb', line 19
def error(message)
build.error(message)
end
|
.file_name ⇒ Object
11
12
13
|
# File 'lib/gitlab/json_logger.rb', line 11
def file_name
file_name_noext + ".log"
end
|
.file_name_noext ⇒ Object
7
8
9
|
# File 'lib/gitlab/json_logger.rb', line 7
def file_name_noext
raise NotImplementedError, "JsonLogger implementations must provide file_name_noext implementation"
end
|
.full_log_path ⇒ Object
40
41
42
|
# File 'lib/gitlab/json_logger.rb', line 40
def full_log_path
Rails.root.join("log", file_name)
end
|
.info(message) ⇒ Object
27
28
29
|
# File 'lib/gitlab/json_logger.rb', line 27
def info(message)
build.info(message)
end
|
.warn(message) ⇒ Object
23
24
25
|
# File 'lib/gitlab/json_logger.rb', line 23
def warn(message)
build.warn(message)
end
|