NetworkLogger ClassDelta Engine Documentation
Logs to a remote location that is listening at the given address and port. By default logs go to the DeltaEngine.net:777 LogService. This way you can manage all issues and view all errors on the DeltaEngine.net website for your project. Or use your own Log Server if you like. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Core Logger
    DeltaEngine.Logging NetworkLogger

Namespace: DeltaEngine.Logging
Assembly: DeltaEngine.Logging (in DeltaEngine.Logging.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class NetworkLogger : Logger

The NetworkLogger type exposes the following members.

Constructors

  NameDescription
Public methodNetworkLogger
Initializes a new instance of the NetworkLogger class
Top
Methods

  NameDescription
Protected methodCreateMessageTypePrefix (Inherited from Logger.)
Public methodDispose (Inherited from Logger.)
Public methodWrite (Overrides Logger Write(Logger MessageType, String).)
Top
Properties

  NameDescription
Public propertyLastMessage (Inherited from Logger.)
Public propertyNumberOfRepeatedMessagesIgnored (Inherited from Logger.)
Top
Remarks

Tests: DeltaEngine.Logging.Tests.NetworkLoggerTests
Examples

7 unit tests call DeltaEngine.Logging.NetworkLogger
[TestFixtureSetUp]
public void StartLogServer()
{
    server = new LocalhostLogServer(new TcpServer());
    server.Start();
    new MockSettings();
    var ready = false;
    var connection = new OnlineServiceConnection();
    connection.DataReceived += o => ready = true;
    connection.Connect("localhost", LocalhostLogServer.Port);
    connection.Send(new LoginRequest("", "DeltaEngine.Logging.Tests"));
    logger = new NetworkLogger(connection);
    for (int timeoutMs = 1000; timeoutMs > 0 && !ready; timeoutMs -= 10)
        Thread.Sleep(10);
    Assert.IsTrue(ready);
}
[TestFixtureTearDown]
public void ShutdownLogServer()
{
    logger.Dispose();
    server.Dispose();
}
[Test]
public void LogInfoMessage()
{
    logger.Write(Logger.MessageType.Info, "Hello");
    ExpectThatServerHasReceivedMessage("Hello");
}
See Also