projects
/
oweals
/
peertube.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add sitemap
[oweals/peertube.git]
/
server
/
helpers
/
logger.ts
diff --git
a/server/helpers/logger.ts
b/server/helpers/logger.ts
index 04a19a9c61adb537cb42249176f67d6f99adf028..203e637a8578d0918bb4530afda366ad5fd28611 100644
(file)
--- a/
server/helpers/logger.ts
+++ b/
server/helpers/logger.ts
@@
-1,5
+1,5
@@
// Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
// Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
-import
* as mkdirp from 'mkdirp
'
+import
{ mkdirpSync } from 'fs-extra
'
import * as path from 'path'
import * as winston from 'winston'
import { CONFIG } from '../initializers'
import * as path from 'path'
import * as winston from 'winston'
import { CONFIG } from '../initializers'
@@
-7,7
+7,7
@@
import { CONFIG } from '../initializers'
const label = CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT
// Create the directory if it does not exist
const label = CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT
// Create the directory if it does not exist
-mkdirp
.s
ync(CONFIG.STORAGE.LOG_DIR)
+mkdirp
S
ync(CONFIG.STORAGE.LOG_DIR)
function loggerReplacer (key: string, value: any) {
if (value instanceof Error) {
function loggerReplacer (key: string, value: any) {
if (value instanceof Error) {
@@
-22,7
+22,13
@@
function loggerReplacer (key: string, value: any) {
}
const consoleLoggerFormat = winston.format.printf(info => {
}
const consoleLoggerFormat = winston.format.printf(info => {
- let additionalInfos = JSON.stringify(info.meta, loggerReplacer, 2)
+ const obj = {
+ meta: info.meta,
+ err: info.err,
+ sql: info.sql
+ }
+
+ let additionalInfos = JSON.stringify(obj, loggerReplacer, 2)
if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = ''
else additionalInfos = ' ' + additionalInfos
if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = ''
else additionalInfos = ' ' + additionalInfos
@@
-50,7
+56,7
@@
const logger = winston.createLogger({
new winston.transports.File({
filename: path.join(CONFIG.STORAGE.LOG_DIR, 'peertube.log'),
handleExceptions: true,
new winston.transports.File({
filename: path.join(CONFIG.STORAGE.LOG_DIR, 'peertube.log'),
handleExceptions: true,
- maxsize: 1024 * 1024 *
30
,
+ maxsize: 1024 * 1024 *
12
,
maxFiles: 5,
format: winston.format.combine(
winston.format.timestamp(),
maxFiles: 5,
format: winston.format.combine(
winston.format.timestamp(),