Esempio n. 1
0
        static void Main(string[] args)
        {
            LogSamples.LogToFiles();
            LogSamples.Log01();
            LogSamples.Log02();
            LogSamples.Log03();
            LogSamples.Log04();

            LogSamples.AddingMultipleAppenders();
            LogSamples.AddingMultipleAppenders2();
            LogSamples.DefaultCategoryTest();


            Console.WriteLine
            (
                "global::log4net.GlobalContext.Properties[\"LogFileName\"] = {0}"
                , global::log4net.GlobalContext.Properties["LogFileName"]
            );


            string app = "";

            app = System.IO.Path.Combine(LogSamples.root_folder, "log4net-file.log");
            System.Diagnostics.Process.Start(app);
            app = System.IO.Path.Combine(LogSamples.root_folder, "log4net-file-rolling.log");
            System.Diagnostics.Process.Start(app);
            Console.ReadLine();
        }
Esempio n. 2
0
        public static void LogTestAll()
        {
            // LogSamples.LogToFiles();

            // Try those - removed (too much output)
            LogSamples.Log01();
            LogSamples.Log02();
            LogSamples.Log03();
            LogSamples.Log04();

            LogSamples.AddingMultipleAppenders();
            LogSamples.AddingMultipleAppenders2();
            LogSamples.DefaultCategoryTest();

            return;
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.LogViewer);

            EditText editTextLoggedMessage = FindViewById <EditText>(Resource.Id.editTextLoggedMessage);
            string   content = LogSamples.LogsRead();

            editTextLoggedMessage.Text =
                content
                //DateTime.Now
                //+ System.Environment.NewLine +
                //Intent.GetStringExtra("Message") ?? "No message??"
                //+ System.Environment.NewLine +
                //editTextLoggedMessage.Text
            ;


            return;
        }
Esempio n. 4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            LogSamples.InitFileLogs();


            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            EditText editTextLogMessage = FindViewById <EditText>(Resource.Id.editTextLogMEssage);
            Button   buttonLogMessage   = FindViewById <Button>(Resource.Id.buttonLogMessage);

            buttonLogMessage.Click += delegate
            {
                LogSamples.Message = editTextLogMessage.Text;

                LogSamples.LogTestAll();
                LogSamples.LogToFiles();

                Intent logViewer = new Intent(this, typeof(ActivityLogViewer));
                StartActivity(logViewer);

                return;
            };

            //Button buttonLogsDelete = FindViewById<Button>(Resource.Id.buttonLogsDelete);
            //buttonLogMessage.Click += delegate
            //{
            //	LogSamples.LogsDelete();
            //};

            return;
        }