Unable to set application-wide LogManager loglevel



I am currently implementing logging for the web application I am working on and the current setup that I have is the following:

I’ve created 2 LogAppenders, one for console and one for logging to server and in main.ts I was planning on setting the logLevel with LogManager.setLevel depending on the environment that the application is running on (production, staging and local). Unfortunately when I set the Logmanager logging level in main.ts in the configure function, some parts of the application take the new loglevel into account and some don’t and I am unable to determine the cause of this.

In addition to the former, I didn’t really find any good examples to teach me, so I would also like to know, should the logger that I get from LogManager.getLogger(‘loggernamewhatever’) be defined below the imports in a file or in the constructors of classes that use logging? For example I have a helper class of models and right now I have the logger definition below imports, one for the entire file (file contains several classes) and logging seems to work without issues.

In another example I have 2 functions in one class, in one the logging works and in the other function it doesn’t. It seems to me like I am doing something terribly wrong :smiley:

Any advice or examples of how you have setup logging on your applications would be very appreciated!

PS. I really like working with Aurelia


Did you ever figure this out? If so could you share an example of how you log from your application?