Logging problem

8 views
Skip to first unread message

Dennis Lambert

unread,
May 30, 2017, 3:51:11 AM5/30/17
to DidiSoft Forum
Hi,

I want to create a log file where all Events get stored. When I add the c# code you provide in the example nothing happens.
No file gets created and if I create the log.txt manually, there are no entries.

I also tried calling with  pgp.LogMessageEvent += Log_Event; directly from a method, but that does not work as well.
What am I doing wrong?

Thanks in advance

Dennis

DidiSoft Support

unread,
May 30, 2017, 4:12:36 AM5/30/17
to didisof...@googlegroups.com, Dennis Lambert
Hi Dennis,

The
pgp.LogMessageEvent += Log_Event
initialization must be called after instantiating the library (PGPLib pgp = new PGPLib())

Can you send me (or paste in the Email) the code of your
Log_Event method.

Kind Regards
Peter Kalef
Technical Support
DidiSoft Inc | Toll free (USA and Canada): 866-253-7568 | International: +1-501-313-0397 | Fax: +1-501-313-0397 | Web: www.didisoft.com
--
You received this message because you are subscribed to the Google Groups "DidiSoft Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to didisoft_foru...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dennis Lambert

unread,
May 30, 2017, 7:53:48 AM5/30/17
to DidiSoft Forum, dlamber...@gmail.com, sup...@didisoft.com
Hi Peter,

I did instantiate the library, before I called pgp.LogMessageEvent += Log_Event.

The Log_Event is like in your example:

 private void Log_Event(object sender, DidiSoft.Pgp.Logging.LogEventArgs e)
 {
     using (StreamWriter log = File.AppendText(@"C:\Encryption\log.txt"))
    {
        log.WriteLine(e.EventTime);
        log.WriteLine(e.Message);
     }
 }

Dennis

DidiSoft Support

unread,
May 30, 2017, 8:03:30 AM5/30/17
to Dennis Lambert, DidiSoft Forum
Hi Dennis,

Please note that not all methods of the library emit log output.

If it's possible, please send me a complete code, so I can test it locally.

Kind Regards
Peter Kalef
Technical Support
DidiSoft Inc | Toll free (USA and Canada): 866-253-7568 | International: +1-501-313-0397 | Fax: +1-501-313-0397 | Web: www.didisoft.com
Reply all
Reply to author
Forward
0 new messages