mendix / m2ee-tools

m2ee, the Mendix runtime helper tools for GNU/Linux
Other
27 stars 40 forks source link

Allow setting log levels before starting #23

Closed knorrie closed 6 years ago

knorrie commented 6 years ago

In Mendix, log categories ("nodes" in the internal pub sub handling) are created when something is logged to them the first time. Since Mendix 6, it's possible to set log levels for nodes that do not exist yet, which makes it possible to set log levels to a value at startup of the application before actually starting to process log messages (the start_logging admin api call).

So, allow configuring log levels in the config file, and have them set up during start.

Previously params for the set_log_level admin call would be {"subscriber": subscriber, "node": node, "level": level}.

Three changes have been made to the API:

Since the original set_log_level call is overloaded with new behavior, the caller has to determine if this new functionality is available based on Mendix Version, it's not possible to dynamically find out except for a trial and error method.

What's the idea for m2ee-tools?

Related proposal: #6 I'm not going to merge this, since it also starts overloading configuration file structures and internal functions with different sorts of behavior, resulting in a forest of if else.

Implementation proposal:

knorrie commented 6 years ago

Implementation done in develop branch. \o/

knorrie commented 6 years ago

Included in v7.2-rc1