Giter Club home page Giter Club logo

dotnetflumeng.clients's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dotnetflumeng.clients's Issues

Problem with connection

Hi,
I have issues getting things to work.
When I start up flume, my log says:

07 Jul 2014 14:41:02,966 INFO agent-shutdown-hook - Configuration provider stopping
07 Jul 2014 14:41:08,122 INFO lifecycleSupervisor-1-0 - Configuration provider starting
07 Jul 2014 14:41:08,122 INFO conf-file-poller-0 - Reloading configuration file:C:\Program Files\apache-flume-1.6.0-SNAPSHOT-bin\conf\flume2.conf
07 Jul 2014 14:41:08,138 INFO conf-file-poller-0 - Processing:Console
07 Jul 2014 14:41:08,138 INFO conf-file-poller-0 - Processing:Console
07 Jul 2014 14:41:08,138 INFO conf-file-poller-0 - Added sinks: Console Agent: agent
07 Jul 2014 14:41:08,138 INFO conf-file-poller-0 - Post-validation flume configuration contains configuration for agents: [agent]
07 Jul 2014 14:41:08,138 WARN conf-file-poller-0 - No configuration found for this host:syslog-agent
07 Jul 2014 14:41:08,153 INFO conf-file-poller-0 - Starting new configuration:{ sourceRunners:{} sinkRunners:{} channels:{} }

When I run run my visual studio application an exception occurs when my program tries to log. The error message is like that:

  •   $exception  {"No connection could be established, connection denied to 127.0.0.1:9090"} System.Exception {System.Net.Sockets.SocketException}
    

Any ideas what I am doing wrong?

Best
Oliver

One more minor fix

diff --git a/DotNetFlumeNG.Client.NLog/NLog/NLogEventAdapter.cs b/DotNetFlumeNG.Client.NLog/NLog/NLogEventAdapter.cs
index 5dffdc7..eabf0f3 100644
--- a/DotNetFlumeNG.Client.NLog/NLog/NLogEventAdapter.cs
+++ b/DotNetFlumeNG.Client.NLog/NLog/NLogEventAdapter.cs
@@ -28,13 +28,14 @@ public class NLogEventAdapter : LogEvent
private readonly string _message;

     public NLogEventAdapter(string message, LogEventInfo logEventInfo)
  •        : base(logEventInfo.TimeStamp)
    
  •        : base(logEventInfo.TimeStamp.ToUniversalTime())
     {
         if (message == null) throw new ArgumentNullException("message");
         if (logEventInfo == null) throw new ArgumentNullException("logEventInfo");
    
         _message = message;
         _logEventInfo = logEventInfo;
    
    • }
     public override LogPriority Priority
    

    diff --git a/DotNetFlumeNG.Client.NLog/Thrift/ThriftFlumeEventAdapter.cs b/DotNetFlumeNG.Client.NLog/Thrift/ThriftFlumeEventAdapter.cs
    index a217e34..d0d0df7 100644
    --- a/DotNetFlumeNG.Client.NLog/Thrift/ThriftFlumeEventAdapter.cs
    +++ b/DotNetFlumeNG.Client.NLog/Thrift/ThriftFlumeEventAdapter.cs
    @@ -19,6 +19,8 @@

    namespace DotNetFlumeNG.Client.Thrift
    {

  • using System.Text;

public class ThriftFlumeEventAdapter : ThriftFlumeEvent
{
public ThriftFlumeEventAdapter(LogEvent logEvent)
@@ -70,9 +72,7 @@ private void SetFields(LogEvent logEvent)

 private static byte[] GetBytes(string str)
 {
  •        var bytes = new byte[str.Length*sizeof (char)];
    
  •        Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
    
  •        return bytes;
    
  •        return Encoding.Default.GetBytes(str);
     }
    

    }
    }

  • Set logtime to UTC

  • default encoding, instead of unicode

hi, how to control this ex?

An exception of type 'System.Net.Sockets.SocketException' occurred in System.dll but was not handled in user code

Additional information: No connection could be made because the target machine actively refused it

This exception cannot be captured by trycatch

Minor patch to get it to work

For me userdomainname is not a valid hostname and timestamp is never set.

GetHostname might be better?

diff --git a/DotNetFlumeNG.Client.NLog/Core/LogEvent.cs b/DotNetFlumeNG.Client.NLog/Core/LogEvent.cs
index d26163c..4ea4545 100644
--- a/DotNetFlumeNG.Client.NLog/Core/LogEvent.cs
+++ b/DotNetFlumeNG.Client.NLog/Core/LogEvent.cs
@@ -47,8 +47,7 @@ public string Host
{
get
{

  •            IPHostEntry he = Dns.GetHostEntry(Environment.UserDomainName);
    
  •            return he.HostName;
    
  •            return Dns.GetHostName();
         }
     }
    

diff --git a/DotNetFlumeNG.Client.NLog/NLog/NLogEventAdapter.cs b/DotNetFlumeNG.Client.NLog/NLog/NLogEventAdapter.cs
index b0b6d12..9607e4e 100644
--- a/DotNetFlumeNG.Client.NLog/NLog/NLogEventAdapter.cs
+++ b/DotNetFlumeNG.Client.NLog/NLog/NLogEventAdapter.cs
@@ -34,6 +34,8 @@ public NLogEventAdapter(string message, LogEventInfo logEventInfo)

         _message = message;
         _logEventInfo = logEventInfo;
  •        this.Timestamp = logEventInfo.TimeStamp;
     }
    
     public override LogPriority Priority
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.