How to use the dailyfile function from tracer

Find comprehensive JavaScript tracer.dailyfile code examples handpicked from public code repositorys.

35
36
37
38
39
40
41
42
43
44
    transport: function(data) {
      stream.write(data.rawoutput + '\n')
    }
  })
} else {
  return tracer.dailyfile({
    format,
    dateformat: 'HH:MM:ss.L',
    preprocess: function(data) {
      data.title = data.title.toUpperCase()
fork icon0
star icon0
watch icon0

+ 4 other calls in file

151
152
153
154
155
156
157
158
159
160
  fs.writeFileSync(pidFile, process.pid, 'utf8')
}

let logger
if (program.daemon) {
  logger = tracer.dailyfile({
    root: path.join(baseDir, 'logs'),
    maxLogFiles: 10,
    allLogsFileName: 'debug',
    dateformat: 'yyyy-mm-dd HH:MM:ss.L'
fork icon0
star icon0
watch icon0

0
1
2
3
4
5
6
7
8
9
10
11
// 파일 저장만


const tracer = require('tracer')
const rTracer = require('cls-rtracer')


const logger_info = tracer.dailyfile({
    root: './logs',
    allLogsFileName: 'info', // [allLogsFileName].[날짜].log 파일에 추가
    format: '{{timestamp}} <{{title}}> ({{file}}:{{line}}) {{message}}',
    dateformat: 'yyyy-mm-dd HH:MM:ss',
fork icon0
star icon0
watch icon0

258
259
260
261
262
263
264
265
266
267
}
try {
  fsex.ensureDirSync(global.app.datadir);
} catch (error) {}
global.app.configfilename = path.resolve(global.app.datadir, './config.json');
global.logger = tracer.dailyfile({
  format: "{{timestamp}} <{{title}}> {{message}}",
  dateformat: "HH:MM:ss l",
  root: path.resolve(global.app.datadir, './logs'),
  maxLogFiles: 14,
fork icon0
star icon0
watch icon0