Skip to content

Commit 815610a

Browse files
authored
Merge pull request #5 from ymyqwe/feature/log4js
Feature/log4js
2 parents 10b9219 + d8222e4 commit 815610a

File tree

7 files changed

+2042
-2001
lines changed

7 files changed

+2042
-2001
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
npm-debug.*
3-
dist/
3+
dist/
4+
logs/

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ os:
77
node_js:
88
- 'node'
99
- 'lts/*'
10-
- '7'
1110
- '8'
1211

1312
script:

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,19 @@ npm start
3636
## TODO
3737

3838
- [x] [Redux](https://github.com/reduxjs/redux)-like style state manage
39-
- [ ] [Log4js](https://github.com/log4js-node/log4js-node)
39+
- [x] [Log4js](https://github.com/log4js-node/log4js-node)
4040
- [ ] [React-router](https://github.com/ReactTraining/react-router)
4141
- [ ] [Typescript](https://github.com/Microsoft/TypeScript)
42-
- [ ] [Webpack-v4](https://github.com/webpack/webpack)
42+
- [x] [Webpack-v4](https://github.com/webpack/webpack)
4343
- [ ] Test
4444

4545
## Changelog
4646

47+
### [2.2.0] / 2019-03-26
48+
49+
- Upgrade webpack to v4
50+
- Add logs using log4js
51+
4752
### [2.1.0] / 2018-12-11
4853

4954
- Refactor Message.js with `useRef` and `useEffect`

conf/log.conf.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// documents https://log4js-node.github.io/log4js-node/dateFile.html
2+
module.exports = {
3+
appenders: {
4+
dateFile: {
5+
type: 'dateFile',
6+
filename: 'logs/chat.log',
7+
pattern: 'yyyy-MM-dd', /* roll log in days */
8+
daysToKeep: 30, /* keep log for 30 days */
9+
layout: { type: 'json', separator: ',' }
10+
}
11+
},
12+
categories: {
13+
default: { appenders: ['dateFile'], level: 'trace' }
14+
}
15+
}

0 commit comments

Comments
 (0)