e49f8d769b22b00ecbeed7a8abbb3794c065fab3
[motion2.git] / server / config / logger.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x957c=['INFO','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','exports','Logger','transports','File','error','%s-%s','info','Console','env','winston','util'];(function(_0x3e0ae1,_0x9a9ecb){var _0x3b92ff=function(_0x572771){while(--_0x572771){_0x3e0ae1['push'](_0x3e0ae1['shift']());}};_0x3b92ff(++_0x9a9ecb);}(_0x957c,0x70));var _0xc957=function(_0x26263c,_0xb68ade){_0x26263c=_0x26263c-0x0;var _0x3ec51c=_0x957c[_0x26263c];return _0x3ec51c;};'use strict';var moment=require('moment');var winston=require(_0xc957('0x0'));var util=require(_0xc957('0x1'));var path=require('path');var debugLevel=_0xc957('0x2');function filename(_0x2b974b,_0x59b150){return path['join'](_0xc957('0x3'),_0xc957('0x4'),_0xc957('0x5'),util[_0xc957('0x6')](_0xc957('0x7'),_0x2b974b,_0x59b150));}function formatter(_0xf2849e,_0x4e4da0){return util['format'](_0xc957('0x8'),moment()[_0xc957('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4e4da0['level'][_0xc957('0x9')](),_0xf2849e,_0x4e4da0['message']);}module[_0xc957('0xa')]=function(_0x59cc32){return new winston[(_0xc957('0xb'))]({'transports':[new winston[(_0xc957('0xc'))][(_0xc957('0xd'))]({'name':util[_0xc957('0x6')]('%s-%s',_0x59cc32,_0xc957('0xe')),'filename':filename(_0x59cc32,_0xc957('0xe')),'level':_0xc957('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x51d6ef){return formatter(_0x59cc32,_0x51d6ef);}}),new winston[(_0xc957('0xc'))]['File']({'name':util[_0xc957('0x6')](_0xc957('0xf'),_0x59cc32,_0xc957('0x10')),'filename':filename(_0x59cc32,'info'),'level':_0xc957('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x46b25e){return formatter(_0x59cc32,_0x46b25e);}}),new winston[(_0xc957('0xc'))][(_0xc957('0x11'))]({'level':process[_0xc957('0x12')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x1a3e6f){return formatter(_0x59cc32,_0x1a3e6f);}})]});};