@athenna/cron 5.5.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -42,6 +42,20 @@ export class CronExceptionHandler {
|
|
|
42
42
|
if (!this.canBeLogged(error)) {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
+
const isUsingJsonFormatter = Config.is('logging.channels.exception.formatter', 'json');
|
|
46
|
+
if (isUsingJsonFormatter) {
|
|
47
|
+
Log.channelOrVanilla('exception').error({
|
|
48
|
+
name: error.name,
|
|
49
|
+
code: error.code,
|
|
50
|
+
status: error.status,
|
|
51
|
+
message: error.message,
|
|
52
|
+
help: error.help,
|
|
53
|
+
cause: error.cause,
|
|
54
|
+
details: error.details,
|
|
55
|
+
stack: error.stack
|
|
56
|
+
});
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
45
59
|
Log.channelOrVanilla('exception').error(await error.prettify());
|
|
46
60
|
}
|
|
47
61
|
/**
|
|
@@ -10,12 +10,8 @@ export class CronKernel {
|
|
|
10
10
|
/**
|
|
11
11
|
* Register the cls-rtracer plugin in the Cron.
|
|
12
12
|
*/
|
|
13
|
-
async registerRTracer(
|
|
14
|
-
if (
|
|
15
|
-
debug('Not able to register rTracer plugin. Set the trace option as true in your cron options.');
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
if (trace === undefined && Config.is('cron.rTracer.enabled', false)) {
|
|
13
|
+
async registerRTracer() {
|
|
14
|
+
if (Config.is('cron.rTracer.enabled', false)) {
|
|
19
15
|
debug('Not able to register rTracer plugin. Set the cron.rTracer.enabled configuration as true.');
|
|
20
16
|
return;
|
|
21
17
|
}
|