1. iliyan iliev
  2. PowerBuilder
  3. Wednesday, 10 October 2018 08:41 AM UTC

It's possible to use log4net with

#if defined pbdotnet then

....

#end if 

in .net webservice with pb nvo components ?!

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 10 October 2018 14:05 PM UTC
  2. PowerBuilder
  3. # 1

Hi Iliyan;

   I have never tried this with LOG4Net but have successfully consumed various .Net classes and methods in PB's .Net based Web Services. So "in theory" you should be able to include the Log4Net's class and then call its methods using the #IF/#EndIF approach.

   In PB2018 with the new C# Web API feature, you should be able to utilize Log4Net. Just make sure that you use the .Net Core version.

   Another alternative could be to use the free STD Web Service framework which supports three types of logging.

For example (internal logging):

IF  THIS.of_is_debug_mode( ) = TRUE THEN                                                     // Debug mode ON?
    THIS.of_write_log ( ls_msg )                                                                            // YES=>log it!
END IF

Note: Framework supports Internal, Event and Debug O/S logging

Regards ... Chris

Comment
There are no comments made yet.
iliyan iliev Accepted Answer Pending Moderation
  1. Friday, 12 October 2018 06:03 AM UTC
  2. PowerBuilder
  3. # 2

Thanks for advice :)

It's possible to add xml configration in web.config from pb code ?!

Everytime when deployed WS web.config rewrite and lost xmlconfiguration for log4net.

Comment
  1. Chris Pollach @Appeon
  2. Friday, 12 October 2018 13:25 PM UTC
Hi Iliyan;

A great question! I have never tried doing that. However, using PB's FileOpen(), FileReadEx() and FileWrite() commands, I do not see why a PB app could not change the contents of that file. As long as it had the correct permissions that is.

Regards ... Chris
  1. Helpful
  1. iliyan iliev
  2. Monday, 15 October 2018 07:25 AM UTC
I tried to write with FileWrite with write rights of IIS-IUSRS but not working.

I find example with log4net.config file and try to use :) Problem with filewrite exists !
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 15 October 2018 14:25 PM UTC
Hopefully, some one will respond to your question who has actually used Log4Net with PB. It might just be a case that you will need to work your way through the In's/Out's of this software package.

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.