Skip to content

Commit

Permalink
fixed logging in osx, supportrt for SerpicoProject#162
Browse files Browse the repository at this point in the history
  • Loading branch information
BuffaloWill committed Sep 5, 2016
1 parent d6f6217 commit 78474e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"auto_import":false, //Experimental, will automatically create new findings on import
"chart":true, //Enabled or disable support,
"user_defined_variables":[], //set your global UDV's here; ["client_start_date","client_abbreviated_name"],
"threshold":"2" // must be a string; "0","1","2"...
"threshold":"2", // must be a string; "0","1","2"...
"log_file":"./log/serpico.log" // set as "" output to the console or /var/log/serpico.log
}
Empty file added log/blank
Empty file.
9 changes: 5 additions & 4 deletions serpico.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
set :show_exceptions, false

#Set Logging
log = File.new("/var/log/serpico.log", "a+")
$stdout.reopen(log)
$stderr.reopen(log)

if(config_options["log_file"] != "")
log = File.new(config_options["log_file"], "a+")
$stdout.reopen(log)
$stderr.reopen(log)
end
# CVSS
set :av, ["Local","Local Network","Network"]
set :ac, ["High","Medium","Low"]
Expand Down
1 change: 1 addition & 0 deletions views/config.haml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- @config.each do |k,v|
- next if k =~ /ssl_certificate/
- next if k =~ /ssl_key/
- next if k =~ /log_file/
- next if k == "cvss" or k == "dread"
%tr
%td
Expand Down

0 comments on commit 78474e5

Please sign in to comment.