UNPKG

4.46 kBJavaScriptView Raw
1/*!
2 * Copyright (c) 2012-2019 Digital Bazaar, Inc. All rights reserved.
3 */
4'use strict';
5
6const config = {};
7module.exports = config;
8
9// cli info
10config.cli = {};
11config.cli.command = null;
12
13// core
14config.core = {};
15
16// 0 means use # of cpus
17config.core.workers = 1;
18
19// error options
20config.core.errors = {};
21// include a stack trace in errors
22config.core.errors.showStack = true;
23
24// group and user IDs:
25// - set if not null if system supports system calls
26// - IDs can be numeric or string names
27
28// master process while starting
29config.core.starting = {};
30// in production may want to use 'adm' group
31config.core.starting.groupId = null;
32config.core.starting.userId = null;
33
34// master and workers after starting
35config.core.running = {};
36config.core.running.groupId = null;
37config.core.running.userId = null;
38
39// master process
40config.core.master = {};
41config.core.master.title = 'bedrock1d';
42
43// worker processes
44config.core.worker = {};
45config.core.worker.restart = false;
46config.core.worker.title = 'bedrock1d-worker';
47
48// constants
49config.constants = {};
50
51// common paths
52config.paths = {
53 // note: defaults configured in bedrock.js to fail.
54 // applications MUST set these if used
55 cache: null,
56 log: null
57};
58
59config.ensureConfigOverride = {};
60// enable this feature when configuration overrides must occur during startup
61config.ensureConfigOverride.enable = false;
62// an array of path strings (e.g. 'mongodb.host', 'session-mongodb.ttl')
63config.ensureConfigOverride.fields = [];
64
65/* logging options
66 * formatter options:
67 * default, json, logstash or a custom formatter function
68 */
69config.loggers = {};
70
71// transport for console logging
72config.loggers.console = {};
73
74config.loggers.console.level = 'debug';
75config.loggers.console.silent = false;
76// bedrock options
77config.loggers.console.bedrock = {};
78config.loggers.console.bedrock.formatter = 'default';
79config.loggers.console.bedrock.colorize = true;
80config.loggers.console.bedrock.onlyModules = false;
81config.loggers.console.bedrock.excludeModules = false;
82
83// file transport for app logging
84config.loggers.app = {};
85config.loggers.app.level = 'debug';
86config.loggers.app.silent = false;
87// note: configured in loggers.js as path.join(config.paths.log, 'app.log')
88config.loggers.app.filename = null;
89config.loggers.app.maxsize = 2 * 1024 * 1024;
90config.loggers.app.maxFiles = 10;
91config.loggers.app.tailable = true;
92// bedrock options
93config.loggers.app.bedrock = {};
94config.loggers.app.bedrock.formatter = 'default';
95config.loggers.app.bedrock.colorize = false;
96// chown the logging dir to bedrock.config.core.running.userId
97config.loggers.app.bedrock.enableChownDir = false;
98
99// file transport for access logging
100config.loggers.access = {};
101
102config.loggers.access.level = 'debug';
103config.loggers.access.silent = false;
104// note: configured in loggers.js as path.join(config.paths.log, 'access.log')
105config.loggers.access.filename = null;
106config.loggers.access.maxsize = 2 * 1024 * 1024;
107config.loggers.access.maxFiles = 10;
108config.loggers.access.tailable = true;
109// bedrock options
110config.loggers.access.bedrock = {};
111config.loggers.access.bedrock.formatter = 'default';
112config.loggers.access.bedrock.colorize = false;
113// chown the logging dir to bedrock.config.core.running.userId
114config.loggers.access.bedrock.enableChownDir = false;
115
116// file transport for error logging
117config.loggers.error = {};
118config.loggers.error.level = 'error';
119config.loggers.error.silent = false;
120
121// note: configured in loggers.js as path.join(config.paths.log, 'error.log')
122config.loggers.error.filename = null;
123config.loggers.error.maxsize = 2 * 1024 * 1024;
124config.loggers.error.maxFiles = 10;
125config.loggers.error.tailable = true;
126// bedrock options
127config.loggers.error.bedrock = {};
128config.loggers.error.bedrock.formatter = 'default';
129config.loggers.error.bedrock.colorize = false;
130// chown the logging dir to bedrock.config.core.running.userId
131config.loggers.error.bedrock.enableChownDir = false;
132
133// transport for email logging
134config.loggers.email = {};
135config.loggers.email.level = 'critical';
136config.loggers.email.to = ['cluster@localhost'];
137config.loggers.email.from = 'cluster@localhost';
138config.loggers.email.silent = true;
139config.loggers.email.json = true;
140config.loggers.email.timestamp = true;
141// bedrock options
142config.loggers.email.bedrock = {};
143
144// categories-transports map
145config.loggers.categories = {
146 app: ['console', 'app', 'error', 'email'],
147 access: ['access', 'error']
148};