snakefoot / snaketail-net

Tail utility for monitoring text log files and Windows EventLog
http://snakenest.com/snaketail/
GNU General Public License v3.0
395 stars 78 forks source link

Clear log files #97

Open allysonsouza opened 8 years ago

allysonsouza commented 8 years ago

There's a option to clear the entire log file, or i need to create a batch to do that? (pointed here, in this issue: https://github.com/snakefoot/snaketail-net/issues/29)

If I still need to create my own program to do that, someone can help me how to do this?

steinhaug commented 6 years ago

Are you looking for a trigger in the logfile to clear/flush the file or how do you mean?

allysonsouza commented 6 years ago

Yes @steinhaug, exactly it, a action to clear the log file, I miss this button in SnakeTail

snakefoot commented 6 years ago

You can configure an external tool in SnakeTail that performs a delete operation of the monitored file.

steinhaug commented 6 years ago

I'm on windows and after I started using external tools I notice that when you launch the program it runs through the logfile triggering all my alarms which is intended for debugging while working... so I solved this one by creating a .cmd file

snaketail-clean-start.cmd

@echo off
echo "" > D:\path\to\snaketail.log 
start "" "C:\Program Files\SnakeTail\SnakeTail.exe" D:\path\to\snaketail-session.xml
exit

Then I added a windows shortcut to the cmd file "snaketail-clean-start.cmd" and voila. Hope this helps

allysonsouza commented 6 years ago

Just if someone comes here searching for that too, here's my batch script to clear the current open file:

echo off

set filepath=%1
set filename=%2

break > %filepath%\%filename%