Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Shuurgan
CN
Last activity: 10 Nov 2024 20:22 EST
logControls not working properly
Hello, I want to use the logController control to output a log file, but after connecting, I run this control and get an error message "No way to change the object's type to level". When it is not connected, the control reports an error message "Value cannot be empty" when selecting all properties. What's going on? Please help, thank you.
BAO
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
@BAOX17175074The method TurnLoggingOn accepts a Pega.Shared.LogLevel as a parameter. Passing the Sender value from the ProjectStarted event would not work. In my test, selecting the log level from the drop down on the automation block worked as expected for me. Are you selecting the value Info from the automation block?
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Shuurgan
CN
@ThomasSasnett Hello,Thomas.I chose on, what should I choose here if it runs normally? BAO
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
@BAOX17175074 You would use the TurnLoggingOn method and then select the log level you wish to enable. Generally speaking, for troubleshooting, I would use the DEBUG level. For initial troubleshooting or maybe validation of simple things, use the INFO level. The higher the level, the larger the files will be, although you can control the size in the Runtime Config.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Shuurgan
CN
@ThomasSasnett I found that Log can be generated without adding this control. Is there any difference between these two logs? BAO
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
@BAOX17175074 The purpose of the Log Controller is to allow you to enable logging within an automation based on some condition. If you are troubleshooting, you would simply turn the logs on using the Runtime Config. I suspect you do not need to use this method unless you have very specific requirements.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
@ThomasSasnett For troubleshooting, you can enable logs in multiple ways. If you are running in Studio, I would enable logging from the Tools-->Options-->Runtime diagnostics menu. If you have a standalone user with only Runtime installed, then you can publish them a in the PegaRuntimeConfig.xml from Robot Manager. If they are not using RM, then you may edit the local copy in %AppData%\Pegasystems.
There are a few main settings I will highlight;
<Logging Enabled="True" AsyncOutput="true" />
This needs to be true for logging to occur.
Under the log4Net section,
<maximumFileSize value="10MB" />
I like to change this to 10000MB (10 GB) to ensure I capture as much of a single session as possible. This might need to be lessened depending on your free disk space. A new log will be created each time, so depending on the maxSizeRollBackups setting, you might want to pay attention to the amount of disk space that might be used.
The LogCategories section defines the log level for each category. Level 4 is the highest and corresponds to DEBUG. 3 is INFO and so on.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
@BAOX17175074 A main use case for using the log controller in an automation might be when a user has an issue that they would like to report to you. They can click a button on their UI that you use to turn logging on while they perform their operation and then disable it afterwards. You can also adjust the level of certain categories, so for example you might not want to log the full text adapter screen (or the HTML of a page) to the log. You can adjust that category to a lower level on startup to essentially override the RuntimeConfig setting. Another might be during a sensitive process; you may wish to disable logging while personal or other sensitive information is being processed.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Shuurgan
CN
@ThomasSasnett thank you Thomas.I will try this. BAO