1

I have built an asp.net core based application. while running the application directly from VS, I am able to receive the logs in the graylog server. But after building the docker container logs are not reaching to the server.

I have tried with both Http and UDP configuration. but it's not sending the logs. I am using Gelf Extension.

    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
    {
        ConfigurationSettings.InitConfig(Configuration.GetSection("ConfigurationSettings"));
        loggerFactory.AddGelf(new GelfLoggerOptions
        {
            Host = ConfigurationSettings.LogHost,
            Port = ConfigurationSettings.LogPort,
            Protocol = GelfProtocol.Http,
            LogSource = ConfigurationSettings.LoggerName,
            LogLevel = LogLevel.Information
        });
    }
Zain Malik
  • 141
  • 3
  • 12
  • can you confirm it can reach the log server? its possible you'll need to expose the port to which its trying to reach your container. basically creating an inbound rule to the container – MattjeS Jun 13 '19 at 15:32
  • i have tried to send log to the server from inside the container shell and its reaching to the server. By using the following command echo -n -e '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }' | nc -w0 -u graylog-server.com 12201 – Zain Malik Jun 13 '19 at 15:56

0 Answers0