Closed thiagoloureiro closed 3 years ago
Hi!
I did some changes because there was an issue when gelf4net couldn't reach graylog server....
Can you post your configuration
bufferSize
retryAfterMilliseconds
httpClientTimeoutMilliseconds
https://github.com/jjchiw/gelf4net/issues/75#issuecomment-796313805
Thanks
My AsyncGelfHttpAppender:
<appender name="AsyncGelfHttpAppender" type="Gelf4Net.Appender.AsyncGelfHttpAppender, Gelf4Net">
<url value="server" />
<!-- Number of log lines to buffer for async send. Defaults to 10-->
<bufferSize value="20" />
<!-- Number of tasks to use for the async appender. 0 or fewer indicates one task per processor-->
<threads value="2" />
<layout type="Gelf4Net.Layout.GelfLayout, Gelf4Net">
<param name="AdditionalFields" value="Application:AsyncHttpAppender,version:${version},envName:${cliente}, stringLevel:%level" />
<param name="Facility" value="Solver-API" />
<param name="IncludeLocationInformation" value="true" />
<param name="SendTimeStampAsString" value="false" />
<!--Sets the full_message and short_message to the specified pattern-->
<!--<param name="ConversionPattern" value="[%t] %c{1} - %m" />-->
</layout>
</appender>
Hi,
Can you tell me more about the environment so I can reproduce it. The tests I did was to run the SimpleWebApplication and used NBomber and it didn't peak....
I'll try during the week with the settings
<bufferSize value="20" />
<threads value="2" />
thanks
LEt me try with your application and will return to you.
I've used your project and reproduced the error:
I've just used my log4net.config and problem appeared
Below my log4net.config
<log4net>
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<!-- Pattern to output the caller's file name and line number -->
<conversionPattern value="%date %5level %logger.%method [%line] - MESSAGE: %message%newline %exception" />
</layout>
</appender>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="example.log" />
<appendToFile value="true" />
<maximumFileSize value="100KB" />
<maxSizeRollBackups value="2" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %5level %logger.%method [%line] - MESSAGE: %message%newline %exception" />
</layout>
</appender>
<appender name="GelfHttpAppender" type="Gelf4Net.Appender.GelfHttpAppender, Gelf4Net">
<url value="http://solver-graylog.eastus.cloudapp.azure.com:12201/gelf" />
<layout type="Gelf4Net.Layout.GelfLayout, Gelf4Net">
<param name="AdditionalFields" value="Application:HttpAppender,version:1.0,envName:%Env%,stringLevel:%level" />
<param name="Facility" value="Solver-API" />
<param name="IncludeLocationInformation" value="true" />
<param name="SendTimeStampAsString" value="false" />
<!--Sets the full_message and short_message to the specified pattern-->
<!--<param name="ConversionPattern" value="[%t] %c{1} - %m" />-->
</layout>
</appender>
<appender name="AsyncGelfHttpAppender" type="Gelf4Net.Appender.AsyncGelfHttpAppender, Gelf4Net">
<url value="http://solver-graylog.eastus.cloudapp.azure.com:12201/gelf" />
<!-- Number of log lines to buffer for async send. Defaults to 10-->
<bufferSize value="20" />
<!-- Number of tasks to use for the async appender. 0 or fewer indicates one task per processor-->
<threads value="2" />
<layout type="Gelf4Net.Layout.GelfLayout, Gelf4Net">
<param name="AdditionalFields" value="Application:AsyncHttpAppender,version:${version},envName:${cliente}, stringLevel:%level" />
<param name="Facility" value="Solver-API" />
<param name="IncludeLocationInformation" value="true" />
<param name="SendTimeStampAsString" value="false" />
<!--Sets the full_message and short_message to the specified pattern-->
<!--<param name="ConversionPattern" value="[%t] %c{1} - %m" />-->
</layout>
</appender>
<appender name="TraceAppender" type="log4net.Appender.TraceAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %5level %logger.%method [%line] - MESSAGE: %message%newline %exception" />
</layout>
</appender>
<appender name="ConsoleAppender" type="log4net.Appender.ManagedColoredConsoleAppender">
<mapping>
<level value="ERROR" />
<foreColor value="Red" />
</mapping>
<mapping>
<level value="WARN" />
<foreColor value="Yellow" />
</mapping>
<mapping>
<level value="INFO" />
<foreColor value="White" />
</mapping>
<mapping>
<level value="DEBUG" />
<foreColor value="Green" />
</mapping>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %5level %logger.%method [%line] - MESSAGE: %message%newline %exception" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="AsyncGelfHttpAppender" />
</root>
</log4net>
Oki
I'll look into it during the week...
I really think is the <bufferSize value="20" />
Thanks :)
Thank you! What value do you recommend using there? Somethiny bigger?
Sent from my iPhone
On 27 Apr 2021, at 00:47, jjchiw @.***> wrote:
Oki
I'll look into it during the week...
I really think is the
Thanks :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
ufff
I think I messed up a little bit with the queue and the reconnection :(
I'll be back as soon as I fixed it
I think It's fixed :)
Thanks for the issue.... I will reopen it and wait for your response.... :)
Problem fixed ! cheers mate!
.NET 5 API
After update, today to the latest versions CPU topped up 100% I had to downgrade.