summaryrefslogtreecommitdiffstats
path: root/config/sys.config
blob: 3b8edc03ad07150d8e18513360fefd66b8b3f359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
[
    {sasl, [{utc_log, true}]}, 

    %% {size, 10485760}, {date, "$D0"}, {count, 5} -> This tells lager to log error and above messages to error.log and to rotate the file at midnight or when it reaches 10mb, whichever comes first, and to keep 5 rotated logs in addition to the current one

    {lager, [
      {colored, true}, 
      {log_root, "/tmp/log/cdapbroker"},

      %%Any logs just starting with lager: will go into stdout and cdapbroker.log. These are the default for non-EELF caught logs
      {handlers, 
          [
            {lager_console_backend, info},
            {lager_file_backend, [{file, "cdapbroker.log"}, 
                                  {level, debug}, 
                                  {formatter, lager_default_formatter}, 
                                  {size, 10485760}, 
                                  {date, "$D0"}, 
                                  {count, 5},
                                  %% Message will hold the delimited fields that the logging standard actually wants
                                  {formatter_config, [message, "--", module ,":", function, ":", line, "\n"]}
            ]}
          ]
      },
      %%EELF logs have special sink names: error:, audit:, metrics:, and optionally debug:
      %%these sinks will log to their respective files, and for sanity reasons, stdout as well
      {extra_sinks,
           [
            {audit_lager_event,
              [{handlers,
                [
                  {lager_console_backend, debug},
                  {lager_file_backend,
                    [{file, "audit.log"},
                     %regarding level, we want the lowest becaue audit:anything will show up in audit.log
                     {level, debug},
                     {formatter, lager_default_formatter}, 
                     {size, 10485760}, 
                     {date, "$D0"}, 
                     {count, 5},
                     %% Message will hold the delimited fields that the logging standard actually wants
                     {formatter_config, [message, "--", module ,":", function, ":", line, "\n"]}]
                  }
                ]
             }]
            },
            {metrics_lager_event,
              [{handlers,
                [
                  {lager_console_backend, debug},
                  {lager_file_backend,
                    [{file, "metrics.log"},
                     %regarding level, we want the lowest becaue metrics:anything will show up in metrics.log
                     {level, debug},
                     {formatter, lager_default_formatter}, 
                     {size, 10485760}, 
                     {date, "$D0"}, 
                     {count, 5},
                     %% Message will hold the delimited fields that the logging standard actually wants
                     {formatter_config, [message, "--", module ,":", function, ":", line, "\n"]}]
                  }
                ]
             }]
            },
            {error_lager_event,
              [{handlers,
                [
                  {lager_console_backend, debug},
                  {lager_file_backend,
                    [{file, "error.log"},
                     %regarding level, we want the lowest becaue error:anything will show up in error.log
                     {level, debug},
                     {formatter, lager_default_formatter}, 
                     {size, 10485760}, 
                     {date, "$D0"}, 
                     {count, 5},
                     %% Message will hold the delimited fields that the logging standard actually wants
                     {formatter_config, [message, "--", " [",severity,"] ", module ,":", function, ":", line, "\n"]}]
                  }
                ]
             }]
            }
           ]
      }
  ]}
].