Comments (6)
This happens when the files are symbolic links too, which means we can't stop logging by just removing a symbolic link but instead have to restart the service.
from remote_syslog.
Still happens in remote_syslog (1.6.15)
from remote_syslog.
This seems to be an interaction with logrotate.
$ sudo lsof | grep deleted
# many other remote_syslog files that are deleted
# ...
remote_sy 26216 26218 root 25r REG 202,1 391179605 176530 /var/log/nginx/core.access.log.1 (deleted)
The default logrotate conf that ubuntu 14.04 ships
/var/log/nginx/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
[ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`
endscript
}
and my log_files.yml looks like:
files:
- # stuff
- /var/log/nginx/core.access.log
destination:
host: logs.papertrailapp.com
port: #####
from remote_syslog.
I think @ChrisLundquist's problem is unrelated to @rolandkool's. @ChrisLundquist: check out copytruncate; that may prevent the leftover open file descriptors.
from remote_syslog.
@troy Thanks for the speedy reply!
Yeah, my goal in the above was to give to simplest way to replicate an issue. You're right that the default nginx logrotate configuration doesn't use copytruncate
. I inherited this setup, so it is possible there was documentation that got missed in the implementation. It seems to me that using papertrail with nginx is a pretty common use case. In my ideal world, remote_syslog would work with a vanilla sudo apt-get install nginx
.
My rails app logs use copytruncate
and see a similar issue.
$ sudo lsof | grep deleted
remote_sy 26216 root 23r REG 202,1 2295124 86059 /path/to/rails/app/e2e590b3d1b4942191c7fd20fbc74997d8b9d63c/build/log/production.log (deleted)
$ cat /etc/logrotate.d/core_service
/path/to/rails/app/current/log/*.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
copytruncate
}
This could be related to the symlink issue, but I'm not entirely sure. current
is a symlink, but it looks like File.expand_path
is called to resolve *.log
to an absolute path.
from remote_syslog.
@ChrisLundquist no problem for the quick reply. I'm going to transition your last email into a thread in our support system (so we can explore your environment more specifically), so please expect an email from support@
late Wednesday or Thursday US time.
from remote_syslog.
Related Issues (20)
- Catch exceptions from YAML parser
- Compression option HOT 3
- is there a way to filter out some strings? HOT 2
- Specify Different Facility Per Logfile HOT 3
- remote_syslog 1.6.14 crashes on: attempted to remove invalid watch signature HOT 25
- max_message_size = 1024 for UDP - why? HOT 1
- remote_syslog 1.6.14 keeps old logfiles open HOT 4
- PID file is not created when passing "no detach" option (-D)
- Constant 3-5% CPU usage per process HOT 7
- Rails Logfile, newlines are converted to <13> HOT 7
- Recommended rewrite in Go HOT 10
- Log all error events by default
- Can't seem to use relative path to ssl_server_cert HOT 5
- Anyone keen to rewrite this in Golang? HOT 10
- Can't process logrotate properly when use the copytruncate option on the logrotate HOT 1
- init script gives error on start HOT 9
- Recent commits to servolux break this gem HOT 4
- RemoteSyslogLogger HOT 8
- The 'exclude_patterns' in config sample is implicit and lack of instruction HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remote_syslog.