You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the answer. Is there maybe an example of using the methods in Log class? Specifically I am interested in how to define the format string and 'args' arguments.
Activity
martinboers commentedon Aug 20, 2024
I think the Log class might help in this case:
This should log a message to the file /opt/plcnext/logs/Output.log.
Note that, by default, DEBUG and TRACE messages are not recorded in that log file. More information here:
https://plcnext.help/te/PLCnext_Runtime/output_log.htm
MaltarIvan commentedon Aug 21, 2024
Thank you for the answer. Is there maybe an example of using the methods in Log class? Specifically I am interested in how to define the format string and 'args' arguments.
martinboers commentedon Aug 21, 2024
It just uses standard C# formatting.
This example is based on the C# function template, and writes the value of the two input parameters to the log file:
There's resources online that explain C# output formatting, e.g.:
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
MaltarIvan commentedon Aug 21, 2024
Ok, I understand now. Thanks for the help!