-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-config.json
executable file
·138 lines (135 loc) · 4.24 KB
/
sample-config.json
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
var path = require("path"),
baseApp = require(process.env.FEATHER_HOME + "/lib/base-app");
var options = {
// Any property /not/ in the environments block is global to all environments
// and is the default. Each environment may still override.
debug: true,
appRoot: __dirname,
daemon: {
runAsDaemon: false,
outputPath: path.basename(__dirname) + '.out',
pidPath: '/tmp/'+path.basename(__dirname)+'.pid'
},
environments: {
dev: {
data: {
authdb: {
/*hostUrl: 'http://localhost',
dbName: 'auth',
dbPort: 5984,
cache: true,
raw: false,
auth: { username:"", password:"" },
useAuth: false,
secure: false*/
},
metadb: {
// ditto
},
appdb: {
hostUrl: 'http://localhost',
dbName:'featherblog',
auth: { username:'featheradmin', password:'password' }
},
authdb: {
hostUrl: 'http://localhost',
dbName: '_users',
auth: { username:'featheradmin', password:'password' }
}
},
auth: {
enabled: true,
userIdPrefix: "org.couchdb.user:"
},
logging: {
enabled: true,
defaultLevel: 'all',// values: all, trace, debug, info, warn, error, fatal, off
absorbConsoleLogging: true,
categories: {
// values: all, trace, debug, info, warn, error, fatal, off
'feather.http': 'off',
'feather.fsm': 'info',
'blog.api': 'debug',
'feather.respack':'warn'
},
appenders: [
{
// Most basic of appenders.
type: 'console',
options: { layout:'colored' }
},
{
type: 'file',
disabled: true,
options: {
layout: 'colored',
filename: 'featherblog.log',
maxFileSize:10*1024*1024,
numBackups:2,
filePollInterval:60,
includedCategories: ['feather.http'],
levelThreshold: 'info'
},
},
{
type: 'file',
disabled: true,
options: {
layout: 'colored',
filename: 'nonhttp.log',
maxFileSize:10*1024*1024,
numBackups:2,
filePollInterval:60,
excludedCategories: ['feather.http'] } },
{
type: 'url',
disabled: true,
options: {
host: 'localhost',
port: '5984',
path:'/featherblog_log/',
excludedCategories: ['feather.http', 'feather.fsm']
}
},
// example of a custom appender. fn should be a function that /is/ the appender.
// In this case, the module pattern is used.
// Incidentally, this is functionally identical to the url appender above.
{ type: 'custom',
disabled: true,
fn: (function() {
var http = require('http');
var connection = http.createClient(5984, 'localhost');
var path = "/featherblog_log/";
var headers = {
"Content-Type": "application/json",
"Content-Length": 0
};
return function(loggingEvent) {
var data = JSON.stringify({
level: loggingEvent.level.levelName,
message: loggingEvent.message,
timestamp: loggingEvent.startTime,
category: loggingEvent.category,
exception: loggingEvent.exception
});
headers['Content-Length'] = data.length;
var req = connection.request("POST", path, headers);
req.write(data);
req.end();
};
})()
}
],
templates: [
{id:'separator', template:'-------------------------------------------------------------------------'}
]
}
}
},
onReady: function() {
feather.ns("feather.blog");
var BlogApi = require("blogapi").BlogApi;
feather.blog.api = new BlogApi();
}
};
feather.start(options);