/**
 * Copyright (c) 2016-present, Agoo.com.co <http://www.agoo.com.co>.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree or translated in the assets folder.
 */
//
// Module dependencies
//
var fs          = require('fs'),
    path        = require('path'),
    winston     = require('winston'),

    filedebug   = path.join(__dirname,'..','logs','debug.log'),
    filerror    = path.join(__dirname,'..','logs','error.log'),
    fileinfo    = path.join(__dirname,'..','logs','info.log');

// Activate winston emitter
winston.emitErrs = true;

// Remove the file, ignoring any errors
try {
    fs.unlinkSync(fileinfo);
    fs.unlinkSync(filedebug);
    fs.unlinkSync(filerror);
}
catch (ex) { }


var logger = new (winston.Logger)({
    transports: [
        new (winston.transports.File)({
            level: 'info',
            name: 'info-file',
            filename: fileinfo,
            handleExceptions: true,
            maxsize: 5242880, // 5 MB
            maxFiles: 5,
            colorize: false
        }),
        new (winston.transports.File)({
            level: 'error',
            name: 'error-file',
            filename: filerror,
            handleExceptions: true,
            maxsize: 5242880, // 5 MB
            maxFiles: 5,
            colorize: false
        }),
        new (winston.transports.File)({
            level: 'debug',
            name: 'debug-file',
            filename:filedebug,
            handleExceptions: true,
            maxsize: 5242880, // 5 MB
            maxFiles: 5,
            colorize: false
        }),
        new (winston.transports.Console)({
            level: 'info',
            handleExceptions: true,
            json: false,
            colorize: true
        })
    ],
    exitOnError: false
});

module.exports.logger = logger;
@@ -268,13 +268,15 @@
  */%0A
-//%0A//
+%0A/**%0A *
  Mod
@@ -292,17 +292,18 @@
 dencies%0A
-/
+ *
 /%0Avar fs
@@ -408,24 +408,26 @@
 ,%0A%0A    f
-iledebug
+olderlogs 
    = pat
@@ -454,16 +454,58 @@
 ','logs'
+),%0A%0A    filedebug   = path.join(folderlogs
 ,'debug.
@@ -539,37 +539,26 @@
 th.join(
-__dirname,'..','
+folder
 logs
-'
 ,'error.
@@ -596,42 +596,139 @@
 oin(
-__dirname,'..','logs','info.log'
+folderlogs,'info.log');%0A%0A/**%0A * Check if folder logs exists.%0A */%0A%0Aif(!(fs.existsSync(folderlogs)))%7B%0A    fs.mkdirSync(folderlogs
 );
+%0A%7D
 %0A%0A//
@@ -752,16 +752,17 @@
  emitter
+.
 %0Awinston
@@ -819,16 +819,17 @@
 y errors
+.
 %0Atry %7B%0A 
@@ -2003,16 +2003,64 @@
 se%0A%7D);%0A%0A
+/**%0A * Export winston logger coniguration.%0A */%0A%0A
 module.e

update logger avoid folder required error