Individual File Logger is not Working

Post Reply
RPierre
Posts: 9
Joined: Wed Jul 17, 2019 8:38 pm

Individual File Logger is not Working

Post by RPierre » Fri Oct 23, 2020 1:33 pm

I'm upgrading from version 1.3.0.0 to 2.8.1.2054 and many things is changed so at version 1.3.0.0 instancing individual file logger to server and each connected client it generate automatic log files with all event trace but at version 2.8.1.2054 does not generate the log files is possible any issue?

I'm looking at https://docs.inetlab.com/smpp/v2/articles/tracing.html and that say "you can set Logger property when you create instances of SmppClient, SmppServerClient or SmppServer" but it does not work i'm doing something wrong?

========== MyCode ==========

When create server instance
_server.Logger = New FileLogger("C:\LOG\SERVER.log", TraceLevel.Verbose)

When create each client instance
_client.Logger = New FileLogger("C:\LOG\CLIENT" & _client.SystemID & ".log", TraceLevel.Verbose)
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Individual File Logger is not Working

Post by alt » Fri Oct 23, 2020 2:46 pm

Do you see any error in Console.Error ?

I would suggest to use NLog or any other logging framework.

https://gitlab.com/inetlab/smpp-samples ... ngWithNLog
RPierre
Posts: 9
Joined: Wed Jul 17, 2019 8:38 pm

Re: Individual File Logger is not Working

Post by RPierre » Fri Oct 23, 2020 4:42 pm

I tryed to use the solution "nlog" but the nlog logfactory maybe global and all log trace is replicated in all files for all clients and server instance at version 1.3.0.0 the log is generated correctly separeted in files for each client and server showing only the repective log in each file, at our work model we separete all log files for each client so client A, B, C etc.. have your repective logfile.
The library 2.82 does not show any error at log pane of visual studio because of that i think it's a issue so have something that i can do to give you more informations about it?
RPierre
Posts: 9
Joined: Wed Jul 17, 2019 8:38 pm

Re: Individual File Logger is not Working

Post by RPierre » Fri Oct 23, 2020 5:26 pm

I found at "warnings" tab that information: "conflicts were found between different versions "System.IO.Compression" that could not be resolved. These reference conflicts are listed in the build log when the log breakdown is set to detailed." and its nothing from my code maybe something about at inetlab.dll?
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Individual File Logger is not Working

Post by alt » Mon Oct 26, 2020 1:13 pm

I cannot reproduce your issue. When I set FileLogger for the client it writes into the file as expected.

Do you change _client.Name after setting FileLogger? Try to do it before.
RPierre wrote:
Fri Oct 23, 2020 5:26 pm
I found at "warnings" tab that information: "conflicts were found between different versions "System.IO.Compression" that could not be resolved. These reference conflicts are listed in the build log when the log breakdown is set to detailed." and its nothing from my code maybe something about at inetlab.dll?
Inetlab.SMPP library has no dependencies. It depends only on target framework.
RPierre
Posts: 9
Joined: Wed Jul 17, 2019 8:38 pm

Re: Individual File Logger is not Working

Post by RPierre » Mon Oct 26, 2020 3:06 pm

alt wrote:
Mon Oct 26, 2020 1:13 pm
I cannot reproduce your issue. When I set FileLogger for the client it writes into the file as expected.

Do you change _client.Name after setting FileLogger? Try to do it before.
RPierre wrote:
Fri Oct 23, 2020 5:26 pm
I found at "warnings" tab that information: "conflicts were found between different versions "System.IO.Compression" that could not be resolved. These reference conflicts are listed in the build log when the log breakdown is set to detailed." and its nothing from my code maybe something about at inetlab.dll?
Inetlab.SMPP library has no dependencies. It depends only on target framework.
I'm changing the name after setting the log file, something is needed to configure before or after start to generate log files? Can you share your code?

======= MyCode ========

client.Logger = New FileLogger("c:\Log\" & client.SystemID & "_CLI.log", TraceLevel.Verbose)
client.Name = "LOG_" & client.SystemId
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Individual File Logger is not Working

Post by alt » Mon Oct 26, 2020 3:30 pm

You should set Logger property after setting Name property.

client.Name = "LOG_" & client.SystemId
client.Logger = New FileLogger("c:\Log\" & client.SystemID & "_CLI.log", TraceLevel.Verbose)
Post Reply