PostgreSQL
 sql >> Base de Dados >  >> RDS >> PostgreSQL

NLog para conexão PostgreSQL


Então pesquisei e obtive a resposta:
 <target name="database" type="Database"> 
    <dbProvider>
        Npgsql.NpgsqlConnection,Npgsql,Version=3.0.3.0,Culture=neutral,PublicKeyToken=5d8b90d52f46fda7
    </dbProvider>
    <connectionString> 
        Server=127.0.0.1;Port=5432;User Id=postgres;Password=postgres;Database=sample;
    </connectionString> 
    <commandText> 
        insert into system_logging(log_date,log_level,log_logger,log_message,log_machine_name, log_user_name, log_call_site, log_thread, log_exception, log_stacktrace) values(@time_stamp, @level, @logger, @message,@machinename, @user_name, @call_site, @threadid, @log_exception, @stacktrace); 
    </commandText> 
    <parameter name="@time_stamp" layout="${longdate}"/> 
    <parameter name="@level" layout="${level}"/> 
    <parameter name="@logger" layout="${logger}"/> 
    <parameter name="@message" layout="${message}"/> 
    <parameter name="@machinename" layout="${machinename}"/> 
    <parameter name="@user_name" layout="${windows-identity:domain=true}"/> 
    <parameter name="@call_site" layout="${callsite:filename=true}"/>
    <parameter name="@threadid" layout="${threadid}"/> 
    <parameter name="@log_exception" layout="${exception}"/> 
    <parameter name="@stacktrace" layout="${stacktrace}"/>
</target>