-
Notifications
You must be signed in to change notification settings - Fork 521
Expand file tree
/
Copy pathriak.schema
More file actions
241 lines (207 loc) · 7.15 KB
/
Copy pathriak.schema
File metadata and controls
241 lines (207 loc) · 7.15 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
%%-*- mode: erlang -*-
%% @doc Where to emit the default log messages (typically at 'info'
%% severity):
%% off: disabled
%% file: the file specified by log.console.file
%% console: to standard output (seen when using `riak attach-direct`)
%% both: log.console.file and standard out.
{mapping, "log.console", "lager.handlers", [
{default, {{console_log_default}} },
{datatype, {enum, [off, file, console, both]}}
]}.
%% @doc The severity level of the console log, default is 'info'.
{mapping, "log.console.level", "lager.handlers", [
{default, info},
{datatype, {enum, [debug, info, notice, warning, error, critical, alert, emergency, none]}}
]}.
%% @doc When 'log.console' is set to 'file' or 'both', the file where
%% console messages will be logged.
{mapping, "log.console.file", "lager.handlers", [
{default, "$(platform_log_dir)/console.log"},
{datatype, file}
]}.
%% @doc The file where error messages will be logged.
{mapping, "log.error.file", "lager.handlers", [
{default, "$(platform_log_dir)/error.log"},
{datatype, file}
]}.
%% @doc When set to 'on', enables log output to syslog.
{mapping, "log.syslog", "lager.handlers", [
{default, off},
{datatype, flag}
]}.
%% @doc When set to 'on', enables log output to syslog.
{mapping, "log.syslog.ident", "lager.handlers", [
{default, "riak"},
hidden
]}.
%% @doc Syslog facility to log entries from Riak.
{mapping, "log.syslog.facility", "lager.handlers", [
{default, daemon},
{datatype, {enum,[kern, user, mail, daemon, auth, syslog,
lpr, news, uucp, clock, authpriv, ftp,
cron, local0, local1, local2, local3,
local4, local5, local6, local7]}},
hidden
]}.
%% @doc The severity level at which to log entries to syslog, default is 'info'.
{mapping, "log.syslog.level", "lager.handlers", [
{default, info},
{datatype, {enum, [debug, info, notice, warning, error, critical, alert, emergency, none]}},
hidden
]}.
{translation,
"lager.handlers",
fun(Conf) ->
SyslogHandler = case cuttlefish:conf_get("log.syslog", Conf) of
true ->
Ident = cuttlefish:conf_get("log.syslog.ident", Conf),
Facility = cuttlefish:conf_get("log.syslog.facility", Conf),
LogLevel = cuttlefish:conf_get("log.syslog.level", Conf),
[{lager_syslog_backend, [Ident, Facility, LogLevel]}];
_ -> []
end,
ErrorHandler = case cuttlefish:conf_get("log.error.file", Conf) of
undefined -> [];
ErrorFilename -> [{lager_file_backend, [{file, ErrorFilename},
{level, error},
{size, 10485760},
{date, "$D0"},
{count, 5}]}]
end,
ConsoleLogLevel = cuttlefish:conf_get("log.console.level", Conf),
ConsoleLogFile = cuttlefish:conf_get("log.console.file", Conf),
ConsoleHandler = {lager_console_backend, ConsoleLogLevel},
ConsoleFileHandler = {lager_file_backend, [{file, ConsoleLogFile},
{level, ConsoleLogLevel},
{size, 10485760},
{date, "$D0"},
{count, 5}]},
ConsoleHandlers = case cuttlefish:conf_get("log.console", Conf) of
off -> [];
file -> [ConsoleFileHandler];
console -> [ConsoleHandler];
both -> [ConsoleHandler, ConsoleFileHandler];
_ -> []
end,
SyslogHandler ++ ConsoleHandlers ++ ErrorHandler
end
}.
%% @doc Whether to enable Erlang's built-in error logger.
{mapping, "sasl", "sasl.sasl_error_logger", [
{default, off},
{datatype, flag},
hidden
]}.
%% @doc Whether to enable the crash log.
{mapping, "log.crash", "lager.crash_log", [
{default, on},
{datatype, flag}
]}.
%% @doc If the crash log is enabled, the file where its messages will
%% be written.
{mapping, "log.crash.file", "lager.crash_log", [
{default, "$(platform_log_dir)/crash.log"},
{datatype, file}
]}.
{translation,
"lager.crash_log",
fun(Conf) ->
case cuttlefish:conf_get("log.crash", Conf) of
false -> undefined;
_ ->
cuttlefish:conf_get("log.crash.file", Conf, "{{platform_log_dir}}/crash.log")
end
end}.
%% @doc Maximum size in bytes of individual messages in the crash log
{mapping, "log.crash.maximum_message_size", "lager.crash_log_msg_size", [
{default, "64KB"},
{datatype, bytesize}
]}.
%% @doc Maximum size of the crash log in bytes, before it is rotated
{mapping, "log.crash.size", "lager.crash_log_size", [
{default, "10MB"},
{datatype, bytesize}
]}.
%% @doc The schedule on which to rotate the crash log. For more
%% information see:
%% https://github.com/basho/lager/blob/master/README.md#internal-log-rotation
{mapping, "log.crash.rotation", "lager.crash_log_date", [
{default, "$D0"}
]}.
%% @doc The number of rotated crash logs to keep. When set to
%% 'current', only the current open log file is kept.
{mapping, "log.crash.rotation.keep", "lager.crash_log_count", [
{default, 5},
{datatype, [integer, {atom, current}]},
{validators, ["rotation_count"]}
]}.
{validator,
"rotation_count",
"must be 'current' or a positive integer",
fun(current) -> true;
(Int) when is_integer(Int) andalso Int >= 0 -> true;
(_) -> false
end}.
{translation,
"lager.crash_log_count",
fun(Conf) ->
case cuttlefish:conf_get("log.crash.rotation.keep", Conf) of
current -> 0;
Int -> Int
end
end}.
%% @doc Whether to redirect error_logger messages into lager -
%% defaults to true
{mapping, "log.error.redirect", "lager.error_logger_redirect", [
{default, on},
{datatype, flag},
hidden
]}.
%% @doc Maximum number of error_logger messages to handle in a second
{mapping, "log.error.messages_per_second", "lager.error_logger_hwm", [
{default, 100},
{datatype, integer},
hidden
]}.
%% @doc Cookie for distributed node communication. All nodes in the
%% same cluster should use the same cookie or they will not be able to
%% communicate.
{mapping, "distributed_cookie", "vm_args.-setcookie", [
{default, "riak"}
]}.
%% override zdbbl from 1mb to 32mb
{mapping, "erlang.distribution_buffer_size", "vm_args.+zdbbl", [
{default, "32MB"},
merge
]}.
%% VM scheduler collapse, part 1 of 2
{mapping, "erlang.schedulers.force_wakeup_interval", "vm_args.+sfwi", [
{default, 500},
{datatype, integer},
merge
]}.
%% VM scheduler collapse, part 2 of 2
{mapping, "erlang.schedulers.compaction_of_load", "vm_args.+scl", [
{default, "false"},
merge
]}.
%% TLS/SSL setting
{mapping, "erlang.proto_dist", "vm_args.-proto_dist", [
%% {default, "inet_tcp"}
{default, "inet_tls -ssl_dist_optfile etc/riak_ssl.conf"}
]}.
{{#devrel}}
%% Because of the 'merge' keyword in the proplist below, the docs and datatype
%% are pulled from the leveldb schema.
{mapping, "leveldb.limited_developer_mem", "eleveldb.limited_developer_mem", [
{default, on},
{level, basic},
merge
]}.
%% @doc erlang vm shutdown_time is useful when running a riak_test devrel
{mapping, "erlang.shutdown_time", "vm_args.-shutdown_time", [
{default, "10s"},
{datatype, {duration, ms}}
]}.
{{/devrel}}