Commit graph

19 commits

Author SHA1 Message Date
Andrea Selva
138b60c839
Explicitate the type of log format in appender's names (#12964) (#12997)
Remove an useful dynamic creation of appender's log file which leverages the `log.format` property
also when it's explicit by the appender itself.

Log4j configuration leverages the placeholder `${sys:ls.log.format}` to compose the name of the log file.
This generates some not evident conflicts in log4j internals, these conflicts became evident when enabling the `pipeline.separate_logs` feature is enabled and the log4j appender definitions contains both json and plain format.
The problem is that under those circumstances the rollover of the log file doesn't happen.

This commit also add a test against the production log4j configuration, to avoid future regressions.

(cherry picked from commit a0774c4e76)
2021-06-17 14:21:24 +02:00
andsel
b0c81338f3 Implements scripted log4j filters and appenders to Java, avoid usage of deprecated Javascript Nashorn (#12512)
- replaces all scripted filters with custom Java implementation
- implemented routing appender per pipeline in Java
- adapted log4j configuration shipped with Logstash
- print a warn message if it detects an scripted log4j configuration and continue the execution (#12591)
2021-01-25 05:46:27 -08:00
Karol Bucek
35d2b391aa Feat: ship log4j2 commons-logging bridge with LS
Having the jar around would allow us to fine tune logging for libraries
such as manticore's http-client (4.5) using LS's `log4j2.properties`
e.g.

```
logger.apache_http_headers.name = org.apache.http.headers
logger.apache_http_headers.level = DEBUG
```
... to log http headers for each request

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2020-06-23 09:39:28 +00:00
Joao Duarte
e5f1e613ef update log4j script routes definition
fixes the change introduced with https://issues.apache.org/jira/browse/LOG4J2-2647
2020-06-09 13:26:30 +00:00
andsel
7a22220467 Added plugin.id to fish tag log lines related to plugins
Fixes #11078
2020-01-23 15:33:31 +00:00
andsel
9b308ae673 Introduced DeprecationLogger for use in core code and exposed to Java and Ruby plugins. Closes 11049
Fixes #11260
2019-11-14 10:49:28 +00:00
João Duarte
15f0de3487 remove 10k character truncation from log4j2.properties
Quite often we see log entries that are truncated by this limit since java stack traces can be very verbose.

This prevents us from seeing the real issue and require us to ask for users to remove the limitation and trigger the issue again so we can see the full problem.

This commit removes this truncation.

Fixes #11206
2019-10-10 10:28:24 +00:00
andsel
fc9c0e0ca2 Added LS configuration variable 'pipeline.separate_logs' to separate logs per pipelines - use log4j RoutingAppender - avoid output to main log files when log per pipeline is enabled - closes 10427
Fixes #11108
2019-10-08 14:07:18 +00:00
andsel
056c3e3bb8 Add pipeline.id to log lines fixes #8290, #10521
Fixes #11075
2019-08-29 10:36:05 +00:00
João Duarte
fe7607abd4
only start monitoring pipeline after valid license (#10106)
Avoid unecessary logging errors and resource usage by only starting
the monitoring pipeline if we can validate the license.
2018-11-07 17:28:48 +00:00
Dan Hermann
1ea1d1982d Add default log retention settings
Relates to #7842

Fixes #8815
2017-12-08 22:55:33 +00:00
Dan Hermann
6c84096a03 retain the 'log' extension
Fixes #8800
2017-12-07 17:18:55 +00:00
Dan Hermann
f1da660c1b Adds size cap for each individual log file. Compresses log files on rollover.
Fixes #7482.

Fixes #8800
2017-12-07 17:18:54 +00:00
Jordan Sissel
60598a0222 Truncate from the end of the message instead of the front.
PatternLayout calls this 'left justify' I think.

Fixes #6255

Fixes #6257
2016-11-15 18:35:12 -05:00
Tal Levy
19d3232873 slowlog
Fixes #6128
2016-11-02 18:48:40 -04:00
Suyog Rao
0a59592fe8 Use format for log file
Fixes #5903
2016-09-13 19:39:27 -04:00
Tal Levy
63233b1cf1 respect log.format and path.logs from cli
also change how `log.level` is configured at startup time to be set
as a property directly in the log4j2.properties file

Fixes #5900
2016-09-13 16:45:30 -04:00
Tal Levy
61ebeb0b4b update path.log to path.logs directory, and respect it in log4j2
Fixes #5876
2016-09-08 18:06:30 -04:00
Tal Levy
1b2f7a7668 Migrate Logstash to Log4j2 Logging (#5651)
Migrate to use Log4j2 for Logstash logging
2016-08-25 10:30:22 -07:00