Today I recreated a docker container with graylog:
docker run --name mongo -d mongo:4.2
docker run --name elasticsearch -e "http.host-0.0.0.0" -e "discovery.type-single-node" -e "ES_JAVA_OPTS-Xms512m -Xmx512m" -d docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
docker run --name graylog4 --link mongo --link elasticsearch -p 9000:9000 -p 12201:12201 -p 1514:1514 -e GRAYLOG_HTTP_EXTERNAL_URI"http://192.168.1.119:9000/" -d graylog/graylog:4.0
I added an input
Then I created a C-app with visual studio, added some nuggets
A little bit of code:
private void button3_Click (object sender, EventArgs e)
{
var configuration - new Microsoft.Extensions.Configuration.ConfigurationBuilder ()
.AddJsonFile ("appsettings.json")
.Build();
Logger logger - new Serilog.LoggerConfiguration
.ReadFrom.Configuration (configuration)
.CreateLogger();
while (true)
{
var line - "cuckoo";
Logger.Warning ("some warning: 'test'), line);
Logger.Information ("some warning: 'test'), line);
}
}
And lo and behold, I added my first information in graylog
Not to mention the appsettings.json file