Git Product home page Git Product logo

log4js2-core's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

log4js2-core's Issues

Strange behavior: partial and intermittent logging

Environment:
node -v : v10.10.0
npm -v : 6.9.0
tsc -v : Version 3.2.2
grep log4j package-lock.json
"@log4js2/core": {
"resolved": "https://registry.npmjs.org/@log4js2/core/-/core-2.0.5.tgz"

Issue:
(NOTE: index.ts implements a GraphQL server using the Prisma Yoga server)
There are several strange aspects in this issue:

  1. There are several loggers defined (imagechest.graphql, firebirdsql.queries, thumbnails.dbqueries ...) but only one (from the main file index.ts) produces output
  2. Even for index.ts, nor the logging nor the console itself displays the very first logging lines (even with virtual console disabled) [see the first "console.log(...)" instruction below]
  3. Logging actually only starts upon the first GraphQL query to index.ts - see log output below, whereas there are a number of logger.debug statements in the code before this point
  4. Logging anomalies started after the functionality of the server got extended and source code became distributed among several source files. Until then, logging seemed quite normal.

--- begin excerpt of main file ---
import { getLogger, configure, LogLevel } from '@log4js2/core';

import { readFileSync } from 'fs';

import { create } from 'rxjs-spy';

import { GraphQLServer } from 'graphql-yoga'

// import * as Firebird from 'node-firebird';
import { Database, Options, pool as Pool, ConnectionPool } from 'node-firebird';

import { sprintf } from 'sprintf-js';
import { isNullOrUndefined } from 'util';

import { Image, Tag, SecundaryTag, ImplicitCaptionRelation } from 'photos/src/public_api';

import { QueryResult, executeQuery as pExecuteQuery, executeSplitQuery as pExecuteSplitQuery } from './firebird-query';
// X
import { Thumbnail, getThumbnailsForFilenameX } from './thumbnails-dbqueries';

// Compile & run commands (2019-01-11): tsc --lib esnext src/index && RXJSSPY_REGEX="^$" DB_CONF_FNAME=ImageChest-PRD-DSB2.json LOG_CONF_FNAME=log4js2-PRD-config.json node src/index
// Compile & run commands (2019-03-24): tsc --lib esnext,dom --declaration src/index && RXJSSPY_REGEX="^$" DB_CONF_FNAME=ImageChest-PRD-DSB2.json LOG_CONF_FNAME=log4js2-TST-config.json node src/index

// ======================== PARAMETERS =================================

const GRAPHQL_PORT = 4004;

// ======================== PARAMETERS =================================

const opts = {
port: GRAPHQL_PORT,
endpoint: '/graphql',
playgroundEndpoint: '/playground'
}

const LOGGING_CONFIG_DEFAULT = {
virtualConsole: true,
// layout: '%d [%p] %c %M:%line:%column - %m %ex',
level: LogLevel.DEBUG,
appenders: ['Console'],
loggers: [/{
tag: 'imagechest.graphql',
level: LogLevel.TRACE
},
{
tag: 'thumbnails.dbqueries',
level: LogLevel.TRACE
}
/]
};

console.log(main: starting server with logger configuration...);
// Logging configuration (with type "any" as IConfiguration is not exported)
const logOptions = readParmsFromFileOrDefault(process.env.LOG_CONF_FNAME, LOGGING_CONFIG_DEFAULT);
configure(logOptions);

function readParmsFromFileOrDefault(fnam: string | undefined, defval: T): T {
let str = (fnam ? readFileSync(fnam, 'utf8') : undefined);
console.info(Config: getting settings from ${fnam ? fnam : '<built-in default config>'});
return (str ? JSON.parse(str) : defval);
}

// logger may only be instantiated after configuration; otherwise it doesn't output anything
const logger = getLogger('imagechest.graphql');
console.info(Logging settings: ${JSON.stringify(logOptions)});

--- end excerpt of main file ---

Sample logging output (from the start) :

tsc --lib esnext,dom src/*.ts && RXJSSPY_REGEX="^$" DB_CONF_FNAME=ImageChest-PRD-DSB2.json node src/index
2019-03-25 18:44:34,643 [DEBUG] imagechest.graphql - getSecundaryTagsForId: entering ... (id=1898)
2019-03-25 18:44:34,946 [DEBUG] imagechest.graphql - getImagesById: entering ... (idList=23497,23498,23499,23500,23501,23729,23730,23731,23732,23733,30598,30599,30600,30601,30613,30614,30615,30616,30617)
2019-03-25 18:44:35,128 [DEBUG] imagechest.graphql - Image/caption_leaf: caption_leaf_id: 1855
2019-03-25 18:44:35,129 [DEBUG] imagechest.graphql - Image/caption_leaf: caption_leaf_id: 1854
2019-03-25 18:44:35,129 [DEBUG] imagechest.graphql - Image/caption_leaf: caption_leaf_id: 1852
2019-03-25 18:44:35,130 [DEBUG] imagechest.graphql - Image/caption_leaf: caption_leaf_id: 1852
2019-03-25 18:44:35,130 [DEBUG] imagechest.graphql - Image/caption_leaf: caption_leaf_id: 1852

Maybe not a bug but still strange and I have already investigated quite a lot: I find no obvious explanation to this behavior.

Below the generated index.js (first lines):
Logger configuration is the first executed instruction after "require()"

"use strict";
// Compile command: tsc --lib esnext,dom src/index.ts
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator"throw"); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (
) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var _this = this;
exports.__esModule = true;
var core_1 = require("@log4js2/core");
var fs_1 = require("fs");
var rxjs_spy_1 = require("rxjs-spy");
var graphql_yoga_1 = require("graphql-yoga");
// import * as Firebird from 'node-firebird';
var node_firebird_1 = require("node-firebird");
var sprintf_js_1 = require("sprintf-js");
var firebird_query_1 = require("./firebird-query");
// X
var thumbnails_dbqueries_1 = require("./thumbnails-dbqueries");
// Compile & run commands (2019-01-11): tsc --lib esnext src/index && RXJSSPY_REGEX="^$" DB_CONF_FNAME=ImageChest-PRD-DSB2.json LOG_CONF_FNAME=log4js2-PRD-config.json node src/index
// Compile & run commands (2019-03-24): tsc --lib esnext,dom --declaration src/index && RXJSSPY_REGEX="^$" DB_CONF_FNAME=ImageChest-PRD-DSB2.json LOG_CONF_FNAME=log4js2-TST-config.json node src/index
// ======================== PARAMETERS =================================
var GRAPHQL_PORT = 4004;
// ======================== PARAMETERS =================================
var opts = {
port: GRAPHQL_PORT,
endpoint: '/graphql',
playgroundEndpoint: '/playground'
};
var LOGGING_CONFIG_DEFAULT = {
virtualConsole: true,
// layout: '%d [%p] %c %M:%line:%column - %m %ex',
level: core_1.LogLevel.DEBUG,
appenders: ['Console'],
loggers: [ /{
tag: 'imagechest.graphql',
level: LogLevel.TRACE
},
{
tag: 'thumbnails.dbqueries',
level: LogLevel.TRACE
}
/]
};
console.log("main: starting server with logger configuration...");
// Logging configuration (with type "any" as IConfiguration is not exported)
var logOptions = readParmsFromFileOrDefault(process.env.LOG_CONF_FNAME, LOGGING_CONFIG_DEFAULT);
core_1.configure(logOptions);
function readParmsFromFileOrDefault(fnam, defval) {
var str = (fnam ? fs_1.readFileSync(fnam, 'utf8') : undefined);
console.info("Config: getting settings from " + (fnam ? fnam : ''));
return (str ? JSON.parse(str) : defval);
}

Thanks in advance for any hint ...
Regards,
Alain

Cannot get log4js2 to compile in my application

Despite to attempts to install log4js2 (the npm site and the project site give 2 slightly different instructions - see below), I cannot get my (otherwise running) application to compile with log4js2.

This is a pity, as the package looks really nice.

First attempt: npm install --save log4js2
Second attempt: npm i -S @log4js2/core

Configuration:
node -v: v10.10.0
npm -v: 6.5.0
tsc -v: Version 3.2.2
OS: ubuntu 18.04LTS

Error message:
ng serve
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2019-01-05T21:37:01.194Z
Hash: 03341d5060cdfc2426d5
Time: 10657ms
chunk {main} main.js, main.js.map (main) 105 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 223 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 554 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 6.21 MB [initial] [rendered]

WARNING in ./node_modules/@log4js2/core/dist/appender/handler/file.handler.d.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@log4js2/core/dist/appender/handler/file.handler.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (/media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:719:23)
at plugin.done.then (/media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)

WARNING in ./node_modules/@log4js2/core/dist/appender/handler/file.writer.d.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@log4js2/core/dist/appender/handler/file.writer.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (/media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:719:23)
at plugin.done.then (/media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)

WARNING in ./node_modules/@log4js2/core/dist/appender/handler/rolling.file.handler.d.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@log4js2/core/dist/appender/handler/rolling.file.handler.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (/media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:719:23)
at plugin.done.then (/media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)

WARNING in ./node_modules/@log4js2/core/dist/appender/handler/file.handler.js.map 1:10
Module parse failed: Unexpected token (1:10)
You may need an appropriate loader to handle this file type.

{"version":3,"file":"file.handler.js","sourceRoot":"","sources":["../../../src/appender/handler/file.handler.ts"],"names":[],"mappings":";AAAA,mCAAkC;AAElC,+CAA2C;AAE3C,MAAa,WAAY,SAAQ,wBAAU;IAOvC,YAAoB,OAA4B;QAE5C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C;SACN;aAAM;YACH,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;SAC3B;IAEL,CAAC;CAEJ;AAtDD,kCAsDC"}

WARNING in ./node_modules/@log4js2/core/dist/appender/handler/file.writer.js.map 1:10
Module parse failed: Unexpected token (1:10)
You may need an appropriate loader to handle this file type.

{"version":3,"file":"file.writer.js","sourceRoot":"","sources":["../../../src/appender/handler/file.writer.ts"],"names":[],"mappings":";AAAA,MAAM,EAAE,GAAG,IAAI,CAAC;AAChB,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,MAAsB,UAAU;IAKrB,MAAM,CAAC,iBAAiB,CAAC,GAAW;QAEvC,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;QACtC,MAAM,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,MAAM,aAAa,GAAG,GAAG,CAAC;QAE1B,OAAO,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE;YAEvD,MAAM,gBAAgB,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;YACrF,IAAI;gBACA,UAAU,CAAC,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;aAC7C;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;oBACvB,OAAO,gBAAgB,CAAC;iBAC3B;gBAED,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;oBACvB,MAAM,IAAI,KAAK,CAAC,qCAAqC,SAAS,GAAG,CAAC,CAAC;iBACtE;gBAED,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBACvE,IAAI,CAAC,SAAS,IAAI,SAAS,IAAI,gBAAgB,KAAK,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;oBAC9E,MAAM,GAAG,CAAC,CAAC,2CAA2C;iBACzD;aACJ;YAED,OAAO,gBAAgB,CAAC;QAC5B,CAAC,EAAE,aAAa,CAAC,CAAC;IACtB,CAAC;IAIS,aAAa,CAAC,QAAkB;QAEtC,IAAI,IAAI,GAAG,CAAC,CAAC;QAEb,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAErB,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACzB,IAAI,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAE/C,OAAO,IAAI,CAAC;IAEhB,CAAC;IAES,aAAa,CAAC,QAAgB;QACpC,OAAO,UAAU,CAAC,EAAE,CAAC,iBAAiB,CAAC,QAAQ,EAAE;YAC7C,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;IACP,CAAC;;AA1Da,aAAE,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AACtB,eAAI,GAAG,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AAH5C,gCA8DC"}

WARNING in ./node_modules/@log4js2/core/dist/appender/handler/rolling.file.handler.js.map 1:10
Module parse failed: Unexpected token (1:10)
You may need an appropriate loader to handle this file type.

{"version":3,"file":"rolling.file.handler.js","sourceRoot":"","sources":["../../../src/appender/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C,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC1D,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;YAE5B,CAAC,CAAC,CAAC;SAEN;aAAM;YACH,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;SAC3B;IAEL,CAAC;IAEO,YAAY;QAChB,OAAO,CAAC,CAAC;IACb,CAAC;CAEJ;AAxFD,gDAwFC"}

ERROR in ./node_modules/@log4js2/core/dist/layout/formatter.js
Module not found: Error: Can't resolve 'path' in '/media/elrond_2tb/devel/angular/keyword-tree-ngrx/node_modules/@log4js2/core/dist/layout'
ℹ 「wdm」: Failed to compile.

Console logging in Node.js shows up in incorrect order

See the output of the test script:

03-25-2016 14:32:18,429 [WARN] anonymous:namedFunctionLogging:19|This is a named warn message
03-25-2016 14:32:18,430 [ERROR] anonymous:namedFunctionLogging:20|This is a named error message null
03-25-2016 14:32:18,430 [WARN] anonymous:anonymous:29|This is a unnamed warn message
03-25-2016 14:32:18,430 [ERROR] anonymous:anonymous:30|This is a unnamed error message null
03-25-2016 14:32:18,407 [INFO] anonymous:namedFunctionLogging:18|This is a named info message
03-25-2016 14:32:18,430 [INFO] anonymous:anonymous:28|This is a unnamed info message
03-25-2016 14:32:18,430 [INFO] anonymous:anonymous:32|This is a test log with parameters

Custom appender does not works

Hi,
i have implemented a custom appender in order to log using sessionStorage of my browser, but after injecting my appender to the logger, nothing happens.

This is a piece of code:

import logger from './helpers/loghelper.js';
const log = logger.getLogger();
log.info('INIT');
.........
logger.addAppender("SESSION");
logger.setLogLevel("ALL");
log.info('DEBUG ON');

I don't know what i did wrong
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.