I write logs into a file

I've tried a lot of configurations but I'm not able to allow logstash to log onto a file. I'm using this log4j configuration

status = error
name = LogstashPropertiesConfig

appender.console.type = Console
appender.console.name = plain_console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %m%n

appender.json_console.type = Console
appender.json_console.name = json_console
appender.json_console.layout.type = JSONLayout
appender.json_console.layout.compact = true
appender.json_console.layout.eventEol = true

appender.rolling.type = RollingFile
appender.rolling.name = rolling
appender.rolling.fileName = logstash.log
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n
appender.rolling.filePattern = logstash-%d{yyyy-MM-dd}.log
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = true

rootLogger.level = ${sys:ls.log.level}
rootLogger.appenderRef.console.ref = ${sys:ls.log.format}_console
rootLogger.appenderRef.rolling.ref = rolling

with this logstash configuration

## Default Logstash configuration from logstash-docker.
## from https://github.com/elastic/logstash-docker/blob/master/build/logstash/config/logstash-oss.yml
http.host: ""
http.port: 9600
path.config: /usr/share/logstash/pipeline
#The directory where Logstash will write its log to.
path.logs: /usr/share/logstash/logs

# The log level. Valid options are: (fatal, error, warn, info, debug and info)
log.level: info

#When set to true, periodically checks if the configuration has changed and reloads the configuration whenever it is changed. This can also be triggered manually through the SIGHUP signal.
config.reload.automatic: true

#How often in seconds Logstash checks the config files for changes.
config.reload.interval: 3

and this docker image version


Now, I want to log log messages of logstash to a file but every attempt failed. What am I doing wrong?

Thanks in andvance.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.