ILog Interface

Provides the methods used to log messages.
Namespace:  AGI.Parallel.Infrastructure.Logging
Assembly:  AGI.Parallel.Infrastructure (in AGI.Parallel.Infrastructure.dll) Version: 1.4.0.476 (1.4.0.476)
Syntax
public interface ILog
Methods
  Name Description
Public method Debug(Object)
Log a message object with the Debug level.
Public method Debug(Object, Exception)
Log a message object with the Debug level including the stack trace of the System.Exception passed as a parameter.
Public method DebugFormat(String, Object)
Logs a formatted message string with the Debug level.
Public method DebugFormat(String, Object)
Logs a formatted message string with the Debug level.
Public method DebugFormat(String, Object, Object)
Logs a formatted message string with the Debug level.
Public method Error(Object)
Log a message object with the Error level.
Public method Error(Object, Exception)
Log a message object with the Error level including the stack trace of the System.Exception passed as a parameter.
Public method ErrorFormat(String, Object)
Logs a formatted message string with the Error level.
Public method ErrorFormat(String, Object)
Logs a formatted message string with the Error level.
Public method ErrorFormat(String, Object, Object)
Logs a formatted message string with the Error level.
Public method Fatal(Object)
Log a message object with the Fatal level.
Public method Fatal(Object, Exception)
Log a message object with the Fatal level including the stack trace of the System.Exception passed as a parameter.
Public method FatalFormat(String, Object)
Logs a formatted message string with the Fatal level.
Public method FatalFormat(String, Object)
Logs a formatted message string with the Fatal level.
Public method FatalFormat(String, Object, Object)
Logs a formatted message string with the Fatal level.
Public method Info(Object)
Log a message object with the Info level.
Public method Info(Object, Exception)
Log a message object with the Info level including the stack trace of the System.Exception passed as a parameter.
Public method InfoFormat(String, Object)
Logs a formatted message string with the Info level.
Public method InfoFormat(String, Object)
Logs a formatted message string with the Info level.
Public method InfoFormat(String, Object, Object)
Logs a formatted message string with the Info level.
Public method Warn(Object)
Log a message object with the Warn level.
Public method Warn(Object, Exception)
Log a message object with the Warn level including the stack trace of the System.Exception passed as a parameter.
Public method WarnFormat(String, Object)
Logs a formatted message string with the Warn level.
Public method WarnFormat(String, Object)
Logs a formatted message string with the Warn level.
Public method WarnFormat(String, Object, Object)
Logs a formatted message string with the Warn level.
Top
Examples
using System;
using AGI.Parallel.Client;
using AGI.Parallel.Infrastructure;
using AGI.Parallel.Infrastructure.Logging;

namespace CodeSamples
{
    class Program
    {
        static void Main(string[] args)
        {
            using (IJobScheduler scheduler = new ClusterJobScheduler("localhost"))
            {
                scheduler.Connect();
                Job job = scheduler.CreateJob();
                job.AddTask(new WriteSomeToLog());
                job.Submit();
                job.WaitUntilDone();
            }

            /*
             * Go to %ALLUSERSPROFILE%\AGI\STK Scalability 1.4\logs to inspect the log files.
             */
        }

        [Serializable]
        class WriteSomeToLog : Task
        {
            public override void Execute()
            {
                ILog logger = this.GetProperty<ILog>(TaskProperties.Logger);

                logger.Error("My text");
                logger.Fatal("should appear");
                logger.Fatal("in the file");
            }
        }
    }
}
See Also

STK Scalability 1.4 API for .NET