aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-02-22 14:16:48 +0100
committerMicael Karlberg <[email protected]>2012-02-22 14:53:10 +0100
commitf9f7bde8524e9863b689275691f4b4711e30d0ff (patch)
tree48df6b404f8a2e71ed267de9fb9882ab39d97d20 /lib/snmp/src/agent/snmpa.erl
parentb5465108cd1456984872e2d04a51af021b4fe110 (diff)
downloadotp-f9f7bde8524e9863b689275691f4b4711e30d0ff.tar.gz
otp-f9f7bde8524e9863b689275691f4b4711e30d0ff.tar.bz2
otp-f9f7bde8524e9863b689275691f4b4711e30d0ff.zip
[snmp] Add log_to_io function for both manager and agent
Add a log_to_io Audit Trail Log converter function for both the manager (snmpm) and agent (snmpa). Also fixed the converter functions in the logger module, snmp_log, which previously sometimes did not work properly (re-open an already open log with different properties). OTP-9940
Diffstat (limited to 'lib/snmp/src/agent/snmpa.erl')
-rw-r--r--lib/snmp/src/agent/snmpa.erl26
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl
index 50b169e4e7..584c7a22fb 100644
--- a/lib/snmp/src/agent/snmpa.erl
+++ b/lib/snmp/src/agent/snmpa.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -83,8 +83,11 @@
-export([add_agent_caps/2, del_agent_caps/1, get_agent_caps/0]).
%% Audit Trail Log functions
--export([log_to_txt/2, log_to_txt/3, log_to_txt/4,
+-export([log_to_txt/1,
+ log_to_txt/2, log_to_txt/3, log_to_txt/4,
log_to_txt/5, log_to_txt/6, log_to_txt/7,
+ log_to_io/1, log_to_io/2, log_to_io/3,
+ log_to_io/4, log_to_io/5, log_to_io/6,
log_info/0,
change_log_size/1,
get_log_type/0, get_log_type/1,
@@ -780,6 +783,8 @@ get_agent_caps() ->
%%% Audit Trail Log functions
%%%-----------------------------------------------------------------
+log_to_txt(LogDir) ->
+ log_to_txt(LogDir, []).
log_to_txt(LogDir, Mibs) ->
OutFile = "snmpa_log.txt",
LogName = ?audit_trail_log_name,
@@ -800,6 +805,23 @@ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) ->
snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop).
+log_to_io(LogDir) ->
+ log_to_io(LogDir, []).
+log_to_io(LogDir, Mibs) ->
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName) ->
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName, LogFile) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName, LogFile, Start) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start).
+log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop).
+
+
log_info() ->
LogName = ?audit_trail_log_name,
snmp_log:info(LogName).