Search Unity

[Solved] Using log4net.Remoting Appender in a Unity project.

Discussion in 'Scripting' started by Sven-Frankson, Aug 8, 2014.

  1. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Hi there,

    I'm encountering some issues trying to use log4net in a Unity project, and would appreciate any help.

    Context
    I want to use an external console for logging purpose. Using log4net, I could be able to log at several locations at the same time.

    Using log4net Remoting Appender on the Unity-side, and a RemoteSink on the external console side, it should work.

    The issue
    A functional consol has been implemented. It can receive logs from a basic program in c#, but can't from my Unity project.

    While my Unity project can use log4net when it comes to log in Unity console or a file, but can't log to my custom console.

    Which means log4net works here, it's very precisely the "Remoting Appender" functionality that I'm having troubles with.
    -----

    If you've ever worked with log4net for Unity, or have solved this issue with another solution, I would greatly appreciate any help ! Gratitudes,

    ----

    Sources may be found here. https://drive.google.com/file/d/0B2P3KCl2M5gONjVJM2c1NEVsMGc/edit?usp=sharing
    "ItsANetworkingTrap" is a basic Unity project, clic the cube to log.
    "OnyxConsole" is a very light custom console using WinForm (Visual Studio project included)
    "Log4NetBeginner" is a simple program logging on the custom console (press any key to see it logging)
     
  2. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    Monday morning, back to work, still stucked on the same issue, trying to bump it... Gratitudes !
     
  3. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    Unity mono does not have pipe / process IO redirect, if that's what you are trying to do
     
  4. Sven-Frankson

    Sven-Frankson

    Joined:
    May 29, 2014
    Posts:
    27
    @r618 : Thanks, that's the issue, as log4net.RemotingAppender requires C# RPC. Had to use another Appender (UdpAppender) which works fine so far.

    Have a nice day !
     
  5. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    There might be something else going on since [RPC] calls should work - albeit the unity way, which is presumably *slightly* different from stock .net/mono RPC
    Cheers !