fluentd: Cannot make to rotate log file of fluentd application on windows
fluentd or td-agent version.
td-agent-3.4.1-0-x64
Environment information:
Operating system: Microsoft Windows 10 Enterprise 1703 BuildNumber: 15063 Version: 10.0.15063 OSArchitecture: 64-bit Kernel version:
Your configuration
C:\opt\td-agent\c
# listen http port
<source>
@type http
port 9880
bind 0.0.0.0
</source>
# send handled messages to elastic
<match **>
@type copy
<store>
@type stdout
</store>
<store>
@type elasticsearch_dynamic
host my.remote.host
port 9200
logstash_prefix buffer_test
logstash_format true
type_name logevent
<buffer>
@type file
path buffer/Handled
total_limit_size 10MB
overflow_action drop_oldest_chunk
queued_chunks_limit_size 10
flush_interval 4s
retry_forever true
flush_thread_count 2
</buffer>
</store>
</match>
Your problem explanation. If you have an error logs, write it together.
Hello! I cannot make to rotate logs file of fluentd application. I use the following command under administrator user to launch program:
fluentd -c c -o C:\opt\td-agent\log --log-rotate-age 3 --log-rotate-size 1000000
But when file C:\opt\td-agent\log reaches the limit of 1000000 bytes, I get messages:
log shifting failed. Permission denied @ rb_file_s_rename - (C:\opt\td-agent\log, C:\opt\td-agent\log.0)
log writing failed. closed stream
log shifting failed. closed stream
log writing failed. closed stream
log shifting failed. closed stream
log writing failed. closed stream
log shifting failed. closed stream
log writing failed. closed stream
log shifting failed. closed stream
log writing failed. closed stream
log shifting failed. closed stream
log writing failed. closed stream
.... (after that many of these lines)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (13 by maintainers)
Commits related to this issue
- Merge pull request #2663 from fluent/logrotate-windows Support logrotate on Windows correctly. Fix #2446 — committed to fluent/fluentd by repeatedly 5 years ago
- Merge pull request #2663 from fluent/logrotate-windows Support logrotate on Windows correctly. Fix #2446 Signed-off-by: Masahiro Nakagawa <repeatedly@gmail.com> — committed to fluent/fluentd by repeatedly 5 years ago
Quoting from the Release notes new mode flag File::SHARE_DELETE is available. this flag means to permit deleting opened file on Windows, but currently this affect only files opened as binary. [Feature #11218]
I see… former seems to easy to implement because we can use SERVERENGINE_WORKER_ID to seperate log files.
I’ve reported this in Ruby language bug tracker.