Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please Support Error Trace #449

Closed
VincentDebug opened this issue Mar 31, 2021 · 8 comments
Closed

Please Support Error Trace #449

VincentDebug opened this issue Mar 31, 2021 · 8 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@VincentDebug
Copy link

VincentDebug commented Mar 31, 2021

error(message: any, trace?: string, context?: string) {
this.updateContext(context);
this.logger.error(message);
}

Just miss trade paramter.

@sosohime
Copy link
Contributor

Myleader, please review this PR
#451

@aquariuslt aquariuslt added bug Something isn't working good first issue Good for newcomers labels Mar 31, 2021
@aquariuslt
Copy link
Member

@wenshenjun release v1.4.0 fixed

@VincentDebug
Copy link
Author

@sosohime @aquariuslt Thanks, Awesome!

@VincentDebug
Copy link
Author

@VincentDebug VincentDebug reopened this Apr 1, 2021
@sosohime
Copy link
Contributor

sosohime commented Apr 1, 2021

I saw the implementation of log4js, its in same line
@aquariuslt what you think about this, myleader
this lib is log4js plugin of nestjs, so we may need to maintain log4js performance rather than nestjs logging?
Based on the above reasons, it should be amended asthis.logger.error(message, trace);

@aquariuslt
Copy link
Member

I saw the implementation of log4js, its in same line
@aquariuslt what you think about this, myleader
this lib is log4js plugin of nestjs, so we may need to maintain log4js performance rather than nestjs logging?
Based on the above reasons, it should be amended asthis.logger.error(message, trace);

yes PR welcome.

@aquariuslt
Copy link
Member

for the practice in Java(logback), implement custom layout and custom layout options replace(p){r, t} and replace multi-line stack trace's \n to other placeholder in sameline is friendly for remote service logger.

but log4js-node not support currently.

see http://logback.qos.ch/manual/layouts.html

replace(p){r, t}

Replaces occurrences of 'r', a regex, with its replacement 't' in the string produces by the sub-pattern 'p'. For example, "%replace(%msg){'\s', ''}" will remove all spaces contained in the event message.

The pattern 'p' can be arbitrarily complex and in particular can contain multiple conversion keywords. For instance, "%replace(%logger %msg){'\.', '/'}" will replace all dots in the logger or the message of the event with a forward slash.

@aquariuslt
Copy link
Member

@sosohime error msg & error in the same line will be better.

like this,
https://github.com/log4js-node/log4js-node/blob/f8d46a939279c0ab4efc8bb5f0478c4b0949a4cf/test/tap/logging-test.js#L33

#451 (comment)_

v 1.5.0 fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants