0

I have installed GrayLog2 on Ubuntu server, and transmitted some messages. The messages show when searching ElasticSearch REST interface, What am I doing wrong? I tries to Google around but it all looks OK, I probably missing something, any help would be appreciated, thanks.

Log4j.xml
<appender name="graylog2" class="org.graylog2.log.GelfAppender">
    <param name="graylogHost" value="10.2.100.65"/>
    <param name="originHost" value="dev"/>
    <param name="extractStacktrace" value="true"/>
    <param name="addExtendedInformation" value="true"/>
    <param name="facility" value="gelf-java"/>
    <param name="Threshold" value="INFO"/>
    <param name="additionalFields" value="{'environment': 'DEV', 'application': 'MyAPP'}"/>
</appender>

The log test:

    public class LogFormatTest {
    protected transient Logger log;

    @Before
    public void init(){
        log = Logger.getLogger(LogFormatTest.class);
    }

    private enum ItalianCars{
        AlfaRomeo          ,
        Fiat               ,
        Abarth             ,
        BaselMotors        ,
        BEngineering       ,
        Centenari          ,
        Bertone            ,
        Casalini           ,
        Covini             ,
        DR                 ,
        Effedi             ,
        Mazzanti           ,
        Ferrari            ,
        Fornasari          ,
        Giottiline         ,
        Lamborghini        ,
        Lancia             ,
        Maserati           ,
        Pagani             ,
        PicchioRacingCars  
    }

    @Test
    public void testme(){
        ItalianCars[] enums = ItalianCars.values();
        for(int i=1; i < 1000; i++){
            String csv = CSVLine.create('  ').with(DateTime.now()).with(i).with(enums[i%enums.length].toString()).build();
            log.info(csv);
        }
    }
}

ElasticSearch: enter image description here

GrayLog2 Index (Show 711 messages):

enter image description here

enter image description here

enter image description here

moshe beeri
  • 2,007
  • 1
  • 17
  • 25

1 Answers1

0

There was no problem in the configuration nor the code. It seems like restarting and deploying as a service of Ubuntu using this install guide just worked. https://www.digitalocean.com/community/tutorials/how-to-install-graylog2-and-centralize-logs-on-ubuntu-14-04

moshe beeri
  • 2,007
  • 1
  • 17
  • 25