First letter of Project missing when using "IncludeInstancePath"
I have my logger congiured as follows:
coreLogger.MinimumLevel(LogLevels.Debug)
.SetDelimiter('|')
.IncludeInstancePath()
.WriteToAds()
.WriteToFile('C:\PLC\Logs\', 'main_log.txt')
.TimestampFormat('YYYY-MM-DD_')
.SetRollingInterval(RollingIntervals.Daily).DeleteLogFilesAfterDays(30);
My Project name is HB1838_PLC_Project:
However when logging I get the following output missing the first letter ("H"):
07/10/2024 14:24:17 121 ms | 'PlcTask' (350): B1838_PLC_Project.MAIN.machine.Zones[0].PressureDamper|Manual override activated
I've also just noticed that this behaviour only happens when using TcLogTRIG. If you just do a normal log call, you get no project name at all (which is probably the best behaviour IMO)
Interesting, thanks for bringing this up. Yes, the project name should not be there at all. I deliberately implemented it to be like that as I found it would not add any relevant information. I'm a bit short of time right now, but this should be an easy fix.
After some investigation, although as you can see from my screenshot, this error certainly occurred, I can no longer reproduce it and from reviewing and stepping through the code, I can't see how this happened, all the code in TcLog to do with the instance name and shortening it seems correct. I may have to put it down to some weird online change behaviour possibly in TwinCAT.