Picture of tsn
Registered 4 years 358 days
tsn Friday, 13 November 2020, 09:29 AM
How to disable logging for app instance?
Hi guys,

Is it possible to completely disable logging for app instance?

Please see attached screenshot from AP Manager where we can find logs for instance.

Best regards,
Sergey
Logging.png

Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Friday, 13 November 2020, 09:42 AM
Re: How to disable logging for app instance?
Hi Sergey,

debug->printf traces are always written to log files, independent of configured log flags (which you can configure differently per instance).
If you use the Log function of your class which is derived from AppInstance, traces are just written to the log file if the App log flag is ticked.

But there is no way to remove the links in the AP Manager ;)

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Friday, 13 November 2020, 09:57 AM
Re: How to disable logging for app instance?
Hi Daniel,

Thank you for quick reply.

Sure, I didn't mean that I want to remove these links ;) Just want to be clear what logs I am talking about as there are also platform logs.

OK, so if the only way to prevent these logs to be created is don't call `Log` in the application then it's fine, I can make this change.

One more questions. Where I can change the max size of the log file? I see this parameter is passed when app instance is launched but not sure where I can change it.

Best regards,
Sergey
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Friday, 13 November 2020, 10:04 AM
Re: How to disable logging for app instance?
Hi Sergey,

if you want to prevent customer users to see your logs, then you must indeed remove Log calls. If you just want to achieve that logs are written depending on log flag settings, you can simply use Log.

Select the App Service in the left tree and then click on Diagnostics. There you can change the log file size for the whole service (independent of a specific instance).

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Friday, 13 November 2020, 10:07 AM
Re: How to disable logging for app instance?
Hi Daniel,

Thank you, I thought this settings are for something else as it didn't work for me.

> If you just want to achieve that logs are written depending on log flag settings, you can simply use Log.
Yes, this is what I want and it doesn't work for me. Regardless of this checkmark I can see the logs. Is it possible to prevent logs to be created if checkmark is unset?

Best regards,
Sergey
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Friday, 13 November 2020, 10:21 AM
Re: How to disable logging for app instance?
Hi Sergey,

test this setting just if you start the App through the AP Manager, not while debugging.
Logflags are transfered by the AP Manager. If you debug your App through Visual Studio, the logflags are taken from your -main.cpp file ;)

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Friday, 13 November 2020, 10:23 AM
Re: How to disable logging for app instance?
Hi Daniel,

Yes, I test it in AP Manager. I have this app deployed separately from app I use for debugging. Please find attached how the settings look like. But in both cases when "Enabled logging" is checked or not I can see the app logs.

Best regards,
Sergey
logging-settings.png

Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 179 days
Daniel Deterding (innovaphone) Friday, 13 November 2020, 10:35 AM
Re: How to disable logging for app instance?
Ah, the "Enable logging" just refers to traces by the AppService class itself.
Every instance has its own log flags which are independent of this flag.

Greetings,
Daniel
Picture of tsn
Registered 4 years 358 days
tsn Friday, 13 November 2020, 11:29 AM
Re: How to disable logging for app instance?
Hi Daniel,

Ok, finally I got your point and now I see that we have "App" checkmark when we click "Diagnostics" for app instance and it prevents logs to be available in AP Manager. Thank you for your help.

Best regards,
Sergey
← You can define your color theme preference here