voroojax / waf-fle

Automatically exported from code.google.com/p/waf-fle
0 stars 0 forks source link

an option to keep the audit log files after they are treated with mlog2waffle #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
* Describe feature request
The option to keep or not the audit log files after they are treated by 
mlog2waffle.
Now, they are auto deleted.

*Witch benefit all users will get with this new feature?

Users can choose to keep them (or not) to do what they want with them.

Here is what I've done to have that option.
I'm not an expert in Perl, so maybe it's not perfect, but that should give you 
a good help to do it (if you think it's worth it):

* In the file mlog2waffle.conf, add:

# Keep (1) or erase (0) the files after having been treated
$KEEP_FILE = 1;

* In the script file mlog2waffle:

(line 60)
our $KEEP_FILE;

(line 159)
         if ($KEEP_FILE eq 0) {
            if (!unlink $file_name) {
               # $logLine = "$timestamp Event $summary sent to console with status, file deleted\n";
               # $logQueue->enqueue($logLine);
            # } else {
               $logLine = "$timestamp Event $summary sent to console, but was impossible to delete the event file\n";
               $logQueue->enqueue($logLine);
            }
         } else {
            # No need to log this in error file
            # $logLine = "$timestamp Event $summary sent to console, file kept\n";
         }

I commented the 3 line after the second 'if' because I want to see in the error 
log file only errors.
Maybe these infos should be displayed in the debug file when DEBUG = TRUE.

Hope this help.

Original issue reported on code.google.com by oxim...@gmail.com on 8 Jan 2014 at 6:03