rudionrails / yell

Yell - Your Extensible Logging Library
MIT License
311 stars 21 forks source link

Datefile adapter - symlink not updating to new path after capistrano deploy #31

Closed pkieltyka closed 7 years ago

pkieltyka commented 10 years ago

I believe the issue is with testing @original_filename, perhaps its just the filename, but it should be the full path

rudionrails commented 10 years ago

Can you give me a bit more info on your setup?

pkieltyka commented 10 years ago

The setup is a sinatra application setting up a logger for the app via:

logger.adapter :datefile, root.join("log/#{environment}.log").to_s, level: 'lte.error', keep: 15

We deploy the webapp via capistrano 3 (but the problem also exists with 2). Capistrano has a folder structure of: /app/releases/YYYYMMDDetc/ which contains a particular instance of that webapp. It then creates a symlink to /app/current to the most up-to-date and successful deploy. A typical setup will also symlink the "log" folder in the webapp to /app/shared/log to keep logs in one place between releases. Yell works great, but once a new deploy is made, the symlink..

/app/current/log/production.log which is also a symlink to /app/current/log/production.YYYYMMDD.log is expanded to /app/releases//log/production.YYYYMMDD.log. When the changes, and current symlink is updated, the log symlink doesn't change. I didn't throw a breakpoint at yell here, but I'm suspecting that in the symlink! method, it's not making a new link when seeing the full path change.. maybe its just using the filename checking if the date has changed.

rudionrails commented 10 years ago

Hi again, sorry for the dalay - been away for the holidays. Just to let you know: I'll have a look at the problem on the weekend and will get back to you.

itsmechlark commented 8 years ago

PING