asp.net mvc - Messages from Gelf4Net are not stored in Graylog2 -


i have ubuntu server elasticsearch, mongodb, , graylog2 running in azure, , have asp.net mvc4 application trying send logs from. (i using gelf4net / log4net logging component). cut chase, nothing being logged.

(skip update see wrong)

the setup

  • 1 xsmall ubuntu vm running needed software graylog2
    • everything running daemon
  • 1 xsmall cloud service mvc4 app (2 instnaces)
  • a virtual network setup can talk.

so have tried?

  • from linux box follow command cause message logged echo "<86>dec 24 17:05:01 foo-bar cron[10049]: pam_unix(cron:session):" | nc -w 1 -u 127.0.0.1 514
  • i can change ip address use public ip , works fine well.
  • using this powershell script can log same message dev machine production web server
  • windows firewall turned off , still doesn't work.
  • i can log fileappender log4net, know log4net working.
  • tailing graylog2.log shows nothing of interest. few warning plugin directory know working, can't gelf4net appender work. i'm loss here. can look? there missing

graylog2.conf

#only showing connection stuff here. if need else let me know syslog_listen_port = 514 syslog_listen_address = 0.0.0.0 syslog_enable_udp = true syslog_enable_tcp = false 

web.config/log4net

//application_start() has log4net.config.xmlconfigurator.configure();  <log4net >   <root>     <level value="all" />     <appender-ref ref="gelfudpappender" />   </root>   <appender name="gelfudpappender" type="gelf4net.appender.gelfudpappender, gelf4net">     <remoteaddress value="public.ip.of.server"/>     <remoteport value="514" />     <layout type="gelf4net.layout.gelflayout, gelf4net">       <param name="facility" value="randomphrases" />     </layout>   </appender> </log4net> 

update

for reason didn't occur me run graylog in debug mode :) doing shows message.

2013-04-09 03:00:56,202 info : org.graylog2.inputs.syslog.syslogprocessor - date not parsed. set because allow_override_syslog_date true. 2013-04-09 03:00:56,202 debug: org.graylog2.inputs.syslog.syslogprocessor - skipping incomplete message.

so sending incomplete message. how can see wrong it?

i using wrong port (doh!)

i should have been using port specified in graylog2.config / gelf_listen_port = 12201

so web.config/log4net/gelf appender should have had

<appender name="gelfudpappender" type="gelf4net.appender.gelfudpappender, gelf4net">    ...     <remoteport value="12201" />    ... </appender> 

for may have same problem, make sure log4net reloads configuration after change it. don't have set watch config file changes, took me few minutes realize using wrong port. when changed 514 12201 first time, messages still weren't getting though. had restart server log4net pick new config, , started work.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -