UNPKG

4.45 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
59// logging
60config.loggers = {};
61
62// transport for console logging
63config.loggers.console = {};
64config.loggers.console.level = 'debug';
65config.loggers.console.silent = false;
66config.loggers.console.json = false;
67config.loggers.console.timestamp = true;
68config.loggers.console.colorize = true;
69// bedrock options
70config.loggers.console.bedrock = {};
71// move 'module' meta to a pretty message prefix if available
72config.loggers.console.bedrock.modulePrefix = true;
73config.loggers.console.bedrock.onlyModules = false;
74config.loggers.console.bedrock.excludeModules = false;
75
76// file transport for app logging
77config.loggers.app = {};
78// winston logger options
79config.loggers.app.level = 'debug';
80config.loggers.app.silent = false;
81config.loggers.app.json = false;
82config.loggers.app.timestamp = true;
83// note: configured in loggers.js as path.join(config.paths.log, 'app.log')
84config.loggers.app.filename = null;
85config.loggers.app.maxsize = 2 * 1024 * 1024;
86config.loggers.app.maxFiles = 10;
87// bedrock options
88config.loggers.app.bedrock = {};
89// chown the logging dir to bedrock.config.core.running.userId
90config.loggers.app.bedrock.enableChownDir = false;
91// move 'module' meta to a pretty message prefix if available
92config.loggers.app.bedrock.modulePrefix = false;
93
94// file transport for access logging
95config.loggers.access = {};
96// winston logger options
97config.loggers.access.level = 'debug';
98config.loggers.access.silent = false;
99config.loggers.access.json = false;
100config.loggers.access.timestamp = true;
101// note: configured in loggers.js as path.join(config.paths.log, 'access.log')
102config.loggers.access.filename = null;
103config.loggers.access.maxsize = 2 * 1024 * 1024;
104config.loggers.access.maxFiles = 10;
105// bedrock options
106config.loggers.access.bedrock = {};
107// chown the logging dir to bedrock.config.core.running.userId
108config.loggers.access.bedrock.enableChownDir = false;
109// move 'module' meta to a pretty message prefix if available
110config.loggers.access.bedrock.modulePrefix = false;
111
112// file transport for error logging
113config.loggers.error = {};
114// winston logger options
115config.loggers.error.level = 'error';
116config.loggers.error.silent = false;
117config.loggers.error.json = false;
118config.loggers.error.timestamp = true;
119// note: configured in loggers.js as path.join(config.paths.log, 'error.log')
120config.loggers.error.filename = null;
121config.loggers.error.maxsize = 2 * 1024 * 1024;
122config.loggers.error.maxFiles = 10;
123// bedrock options
124config.loggers.error.bedrock = {};
125// chown the logging dir to bedrock.config.core.running.userId
126config.loggers.error.bedrock.enableChownDir = false;
127// move 'module' meta to a pretty message prefix if available
128config.loggers.error.bedrock.modulePrefix = false;
129
130// transport for email logging
131config.loggers.email = {};
132config.loggers.email.level = 'critical';
133config.loggers.email.to = ['cluster@localhost'];
134config.loggers.email.from = 'cluster@localhost';
135config.loggers.email.silent = true;
136config.loggers.email.json = true;
137config.loggers.email.timestamp = true;
138// bedrock options
139config.loggers.email.bedrock = {};
140
141// categories-transports map
142config.loggers.categories = {
143 app: ['console', 'app', 'error', 'email'],
144 access: ['access', 'error']
145};