| Auszug |
|---|
|
Nuclos exception logging: stacktrace-business.log, stacktrace-internal.log, InternalErrorException, hash code, log rotation, log4j2. |
Language: Deutsch · English
Exception logging
Separate stack trace logs – business/internal, hash code mapping and log rotation.
| Status |
|---|
| colour | Blue |
|---|
| title | Administrator |
|---|
|
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
Exceptions sent to the client no longer contain a stack trace/cause – these are stored separately on the server. RuntimeExceptions become a neutral InternalErrorException with a hash code that lets you find the original stack trace in the log. BusinessExceptions go to the client (without stack trace) with all needed extras (InputRequired, FieldValidation).
stacktrace-business.log
Reduced stack traces of BusinessExceptions (infrastructure lines from Nuclos/Spring/Java/Tomcat are omitted):
| Codeblock |
|---|
|
2020-06-24 08:29:40 - null
org.nuclos.api.context.InputRequiredException: null
at extension.nuclet.test.rules.TestInputRequiredExceptionExtension.doInputMemo(TestInputRequiredExceptionExtension.java:198) ~[nuclos-integration-tests-rules-4.43.0-SNAPSHOT.jar:?]
at extension.nuclet.test.rules.TestInputRequiredExceptionExtension.doInputRequired(TestInputRequiredExceptionExtension.java:53) ~[nuclos-integration-tests-rules-4.43.0-SNAPSHOT.jar:?]
at extension.nuclet.test.rules.TestInputRequiredExceptionExtension.custom(TestInputRequiredExceptionExtension.java:34) ~[nuclos-integration-tests-rules-4.43.0-SNAPSHOT.jar:?] |
stacktrace-internal.log
Full stack trace of all other (runtime) exceptions. Each entry starts with the hash code # also shown in the client:
| Codeblock |
|---|
|
#-22567581 2020-06-24 09:17:21
java.lang.NullPointerException: null
at org.nuclos.server.eventsupport.ejb3.EventSupportFacadeBean.createBusinessObject(EventSupportFacadeBean.java:1855) ~[nuclos-server-4.43.0-SNAPSHOT.jar:?]
at org.nuclos.server.eventsupport.ejb3.EventSupportFacadeBean.executeUpdateSupportEvent(EventSupportFacadeBean.java:1555) ~[nuclos-server-4.43.0-SNAPSHOT.jar:?]
at org.nuclos.server.eventsupport.ejb3.EventSupportFacadeBean.fireSaveEventSupport_aroundBody62(EventSupportFacadeBean.java:2183) ~[nuclos-server-4.43.0-SNAPSHOT.jar:?]
at org.nuclos.server.eventsupport.ejb3.EventSupportFacadeBean$AjcClosure63.run(EventSupportFacadeBean.java:1) ~[nuclos-server-4.43.0-SNAPSHOT.jar:?]
at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:66) ~[spring-aspects-4.3.17.RELEASE.jar:4.3.17.RELEASE]
... |
The corresponding entry in server.log:
| Codeblock |
|---|
|
2020-06-24 09:17:21,916 WARN [org.nuclos.server.common.NuclosRemoteInvocationExecutor] - InternalError '#-22567581 2020-06-24 09:17:21': java.lang.NullPointerException |
Log rotation
The files rotate hourly; at most 8 stacktrace-business and 512 stacktrace-internal files are kept. Configurable in conf/log4j2.xml:
| Codeblock |
|---|
|
<RollingFile name="StacktraceBusiness" fileName="${server.home}/logs/stacktrace-business.log"
filePattern="${server.home}/logs/stacktrace-business-%d{yyyy-MM-dd-hh}.log.gz"
append="true">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} - %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy filePattern="${server.home}/logs/stacktrace-business-%d{yyyy-MM-dd-hh}.log.gz" />
</Policies>
<DefaultRolloverStrategy max="8"/>
</RollingFile>
<RollingFile name="StacktraceInternal" fileName="${server.home}/logs/stacktrace-internal.log"
filePattern="${server.home}/logs/stacktrace-internal-%d{yyyy-MM-dd-hh}.log.gz"
append="true">
<PatternLayout pattern="%m%n"/>
<Policies>
<TimeBasedTriggeringPolicy filePattern="${server.home}/logs/stacktrace-internal-%d{yyyy-MM-dd-hh}.log.gz" />
</Policies>
<DefaultRolloverStrategy max="512"/>
</RollingFile> |
| Warnung |
|---|
| title | Installer & legacy behaviour |
|---|
|
The installer resets conf/log4j2.xml. For permanent changes copy the file to extensions/conf. To write everything back to server.log, set additivity="true" on the stack trace loggers. |
Related pages