Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Instead, we should make use of these methods provided by LogUtil. Check out the some sample in the codes used by Email Tool (Source code: https://github.com/jogetworkflow/jw-community/blob/6.0-SNAPSHOT/wflow-core/src/main/java/org/joget/apps/app/lib/EmailTool.java#L227)

...

In the section above, we talked about using LogUtil to write into the log filefiles and how to write into separate files too. When we have too many apps running in the same copy of Joget, sometimes it is hard to tell where certain line of messages come from which appstrace certain line of messages to the origin of Joget apps that trigger them.

For example, let's look at these log messages.

Code Block
titleSample log messages
linenumberstrue
ERROR 17 Jun 2019 17:29:39 org.joget.apps.app.lib.EmailTool  - org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.outlook.comtest:587
org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.outlook.comtest:587
	at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421)
	at org.apache.commons.mail.Email.send(Email.java:1448)
	at org.joget.apps.app.lib.EmailTool$1.run(EmailTool.java:239)
	at java.lang.Thread.run(Thread.java:748)
	at org.joget.commons.util.PluginThread.run(PluginThread.java:22)

There is no way that we can tell from which Joget app the EmailTool is triggered. However, in a Process Tool's execute method, we can obtain the appDef object which contains the Joget app information.

Code Block
languagejava
public Object execute(Map properties) {
	.
	.
	AppDefinition appDef = (AppDefinition) properties.get("appDef");
	.
	.
	.
	String appInfoAndMessage = appDef.toString() + "- Something happened";
	LogUtil.error(EmailTool.class.getName(), ex, appInfoAndMessage);
	.
}

This way, we would be able to trace to the app that triggers and writes the line of message in the log file.

Large catalina.out File

We can consider to LogRotate the log files. Please see the following links:-

...