Jahaja/psdash

warnings for dir entries under log paths (or: request for recursive log dir option?)

Closed this issue · 6 comments

Just updated to the latest version (it's been a while! nice updates! Works on OS X now!), and seeing this:

WARNING | psdash.log | Could not read log file "/mnt/service/logs/graphite" ([Errno 21] Is a directory: u'/mnt/service/logs/graphite')

Our log files are nested, and log files come and go (rotated out), so I start psdash with "--log /mnt/service/logs/* --log /mnt/service/logs// --log /mnt/service/logs///*". This gets us three levels, quite nicely.

Can the warnings for dir entries be ignored? Or maybe as a feature request, adding a --recurssive-log-dir option might be generally useful?

Thanks!
-Jeff

Hi!
Do you still get warnings if you use this pattern: /mnt/service/logs/**? It's the recursive version.

Ahhhh. That makes so much more sense; wouldn't have thought of that. Thanks!

Hi Joakim,

Actually, we're still getting the warnings. Using "" finds all files -- which includes directory entries. We can't use something like */.log because we're handling many different services with various log file extensions that are unknown to our psdash instance.

So, maybe a simple:
if not os.path.isdir(log_file) self.add_available(log_file)
in log.py would avoid this? That'll work for the most part (unless log_file is a symlink to a dir...)

-Jeff

Ah, good find. I'll look into it.

Fixed by bfbba02. Thanks for reporting!

Thanks for the quick fix!