|
|
@ -24,32 +24,33 @@ |
|
|
|
|
|
|
|
%% rumBkdConsole的选项 |
|
|
|
-type rumConsoleOpt() :: |
|
|
|
{id, atom() | {atom(), atom()}} | |
|
|
|
{use_stderr, boolean()} | |
|
|
|
{group_leader, false | pid() | atom()} | |
|
|
|
{formatTer, atom()} | |
|
|
|
{formatCfg, list()}. |
|
|
|
{id, atom() | {atom(), atom()}} | |
|
|
|
{use_stderr, boolean()} | |
|
|
|
{group_leader, false | pid() | atom()} | |
|
|
|
{formatTer, atom()} | |
|
|
|
{formatCfg, list()}. |
|
|
|
|
|
|
|
%% rumBkdFile的选项 |
|
|
|
-type rumFileOpt() :: |
|
|
|
{file, binary()} | |
|
|
|
{level, rumAtomLevel() | atom()} | |
|
|
|
{size, non_neg_integer()} | |
|
|
|
{date, string()} | |
|
|
|
{count, non_neg_integer()} | |
|
|
|
{rotator, atom()} | |
|
|
|
{hWM, non_neg_integer()} | |
|
|
|
%% 对于特定的接收器事件队列刷新,请使用改选项 |
|
|
|
{flushQueue, boolean()} | |
|
|
|
%% 对于接收器 如果flush_queue为true,则可以设置消息队列长度阈值,在该阈值处将开始丢弃消息。默认阈值为0, |
|
|
|
%% 这意味着如果flush_queue为true,则超过高水位标记时将丢弃消息,而不管消息队列的长度如何。: |
|
|
|
{flushThr, non_neg_integer()} | |
|
|
|
{syncInt, non_neg_integer()} | |
|
|
|
{syncSize, non_neg_integer()} | |
|
|
|
{syncOn, rumAtomLevel()} | |
|
|
|
{checkInt, non_neg_integer()} | |
|
|
|
{formatTer, atom()} | |
|
|
|
{formatCfg, term()}. |
|
|
|
{id, atom()} | |
|
|
|
{file, binary()} | |
|
|
|
{level, rumAtomLevel() | atom()} | |
|
|
|
{size, non_neg_integer()} | |
|
|
|
{date, string()} | |
|
|
|
{count, non_neg_integer()} | |
|
|
|
{rotator, atom()} | |
|
|
|
{hWM, non_neg_integer()} | |
|
|
|
%% 对于特定的接收器事件队列刷新,请使用改选项 |
|
|
|
{flushQueue, boolean()} | |
|
|
|
%% 对于接收器 如果flush_queue为true,则可以设置消息队列长度阈值,在该阈值处将开始丢弃消息。默认阈值为0, |
|
|
|
%% 这意味着如果flush_queue为true,则超过高水位标记时将丢弃消息,而不管消息队列的长度如何。: |
|
|
|
{flushThr, non_neg_integer()} | |
|
|
|
{syncInt, non_neg_integer()} | |
|
|
|
{syncSize, non_neg_integer()} | |
|
|
|
{syncOn, rumAtomLevel()} | |
|
|
|
{checkInt, non_neg_integer()} | |
|
|
|
{formatTer, atom()} | |
|
|
|
{formatCfg, term()}. |
|
|
|
|
|
|
|
%% BkdFile选项默认值 |
|
|
|
-define(RumDefLogLevel, info). |
|
|
@ -58,12 +59,12 @@ |
|
|
|
-define(RumDefRotateCnt, 5). |
|
|
|
-define(RumDefRotateMod, rumRotatorIns). |
|
|
|
-define(RumDefSyncLevel, error). |
|
|
|
-define(RumDefSyncInt, 1000). |
|
|
|
-define(RumDefSyncInt, 1000). %% 单位毫秒 |
|
|
|
-define(RumDefSyncSize, 1024 * 64). %% 64kb |
|
|
|
-define(RumDefCheckInt, 1000). |
|
|
|
-define(RumDefCheckHWM, 1000). %% IMY-todo修正该默认值 |
|
|
|
-define(RumDefFlushQueue, true). |
|
|
|
-define(RumDefFlushThr, 0). %% IMY-todo修正该默认值 |
|
|
|
-define(RumDefCheckInt, 1000). %% 单位毫秒 |
|
|
|
-define(RumDefCheckHWM, undefined). |
|
|
|
-define(RumDefFlushQueue, false). |
|
|
|
-define(RumDefFlushThr, 10). |
|
|
|
-define(RumDefFormatTer, rumFormatTer). |
|
|
|
-define(RumDefFormatterCfg, []). |
|
|
|
|
|
|
@ -71,8 +72,8 @@ |
|
|
|
-define(RumDefHandler, |
|
|
|
[ |
|
|
|
{rumBkdConsole, [{level, info}]}, |
|
|
|
{rumBkdFile, [{file, <<"./log/error.log">>}, {level, '>=error'}, {size, 10485760}, {date, "$D0"}, {count, 5}]}, |
|
|
|
{rumBkdFile, [{file, <<"./log/console.log">>}, {level, '>=debug'}, {size, 10485760}, {date, "$D0"}, {count, 5}]} |
|
|
|
{rumBkdFile, [{id, error}, {file, <<"./log/error.log">>}, {level, '>=error'}, {size, 10485760}, {date, "$D0"}, {count, 5}]}, |
|
|
|
{rumBkdFile, [{id, console}, {file, <<"./log/console.log">>}, {level, '>=debug'}, {size, 10485760}, {date, "$D0"}, {count, 5}]} |
|
|
|
]). |
|
|
|
|
|
|
|
-record(rumShaper, { |
|
|
|