using System;
using org.apache.log4j;
using java.lang;
using loggerDemo; // class in logging.dll  (added as reference to this project)

namespace LoggerDemo
{
    class LoggerDemo
    {
        static Category cat =
            Category.getInstance(typeof(LoggerDemo).FullName);

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            BasicConfigurator.configure();

            cat.info(new JavaString("Entering application"));
            DotNetClass dotNetClass = new DotNetClass();
            JavaClass javaClass = new JavaClass();
            for (int i = 0; i < 5; i++)
            {
                dotNetClass.f();
                javaClass.doIt();
            }
            cat.info(new JavaString("Exiting application"));
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
    }

    public class DotNetClass
    {
        static Category cat =
            Category.getInstance(typeof(DotNetClass).FullName);

        public void f()
        {
            cat.debug(new JavaString("Logged from .NET"));
        }
    }
}
