web stats
Mirth Community - View Single Post - New Feature: Mirth logging replacement
View Single Post
  #11  
Old 01-29-2020, 06:42 AM
odo odo is offline
OBX.3 Kenobi
 
Join Date: Feb 2017
Location: Luxembourg
Posts: 165
odo is on a distinguished road
Default

Quote:
Originally Posted by hheldenbrand View Post
However, I am not able to get the customLogPath feature to work. I have tried quite a few different variations in my activation call, providing paths with a file name and without, in my home directory and in subfolders of Mirth's default logging folder:

Packages.lu.hrs.mirth.MetaAppender.activate("/opt/mirthconnect/logs/test/test.log");

In the current version, the meta appender is only created once, at the first call (usually the 1st time the global deploy script is called).
All subsequent calls will returned the cached instance. This is done for performance reasons.


Thus, if you would like a custom log path, you would have to provide this parameter where activate is called the first time. Alternatively you can simply change the log path in the configuration file (<MIRTH HOME>\conf\log4j.properties)

This custom path is however used for all log files. The logfile names are fix. (e.g. log files of channels are named like the channel). Thus, please provide the logpath without a filename.


I might change the code in a future version to detect, when parameters are changed. This, however, comprises a potential risk as two alternating calls from different locations with different values e.g. for the logfile location might result in unwanted behavior.


EDIT: When I think about it: An additional feature similar to the focus() feature might be a feasible way for securely supporting custom locations for single log files. I will have a look at that as soon as I get some time.

Last edited by odo; 01-29-2020 at 06:46 AM.
Reply With Quote