ZengCode.Com (The Thai Php Framework)  


Home   Download   Manual   About us    

Facebook   


MAIN MENU
News
Php Tips
Android Programming
Design Pattern By PHP
C# using Linq น่าใช้จริงๆ
C# Tips & Technique
C# Design Pattern
Linux Quick Tips
Java & JavaScript Tips
Database & SQL
ZengCode Framework Guide
Zeng Code Code
Programming
IPhone (Tips and Trick)

Download เอกสารที่น่าสนใจ

     มี DLL สำหรับเขียน Log มาฝากครับ   (2010-02-16)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using ZCLogger;

namespace TestSolution
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Logger.writeLog = true;  //default is true    true= write log file , false = not write log file
            Logger.debugMode = true; //default is flase   true=write debug log, false = not write debug log
           

            Logger.loggerPath = "C://Logs";
            Logger.PutLog("Info", 0, "test info");
            Logger.PutLog("Info", 100, "test info");
            Logger.PutLog("Info", 2, "test info");

            Logger.PutLog("Exception", 0, "test Exception");
            Logger.PutLog("Exception", 100, "test Exception");
            Logger.PutLog("Exception", 2, "test Exception");

            Logger.PutLog("SQL", 0, "Test SQL LOG");
            Logger.PutLog("SQL", 100, "Test SQL LOG");
            Logger.PutLog("SQL", 2, "Test SQL LOG");
            Logger.PutLog("sql", 2, "Test SQL LOG");

            Logger.PutLog("Debug", 0, "Test Debug LOG");
            Logger.PutLog("Debug", 0, "Test Debug LOG");
            Logger.PutLog("Debug", 0, "Test Debug LOG");
        }
    }
}

ผมพัฒนาด้วย C# นะครับเขียนแบบง่าย ๆ ไม่อยากใช้ของใคร อ่ะ
parameter ตัวแรกคือ Log type เพิ่มเติมได้จำนวนไม่จำกัดนะครับ(case insensitive)  Log จะเขียนชื่อไฟล์ดังตัวอย่างนี้เช่น

Logger.PutLog("SQL", 2, "Test SQL LOG");
Logger.PutLog("sql", 2, "Test SQL LOG");

======> yyyy-MM-dd_SQL.log  เป็นต้น

Download DLL CLICK


Comment

ZengCode  (19 กุมภาพันธ์ 2553)   
IP : 58.137.188.243

Logger.loggerPath = "C://Logs";
            Logger.PutLog("Info" 0 "test info");
            Logger.PutLog("Info" 100 "test info");
            Logger.PutLog("Info" 2 "test info");

            Logger.PutLog("Exception" 0 "test Exception");
            Logger.PutLog("Exception" 100 "test Exception");
            Logger.PutLog("Exception" 2 "test Exception");

            Logger.PutLog("SQL" 0 "Test SQL LOG");
            Logger.PutLog("SQL" 100 "Test SQL LOG");
            Logger.PutLog("SQL" 2 "Test SQL LOG");
            Logger.PutLog("sql" 2 "Test SQL LOG");

            Logger.PutLog("Debug" 0 "Test Debug LOG ภาษาไทยได้ไหมเนี้ย เห่อๆๆๆๆๆๆ");
            Logger.PutLog("Debug" 0 "Test Debug LOG");
            Logger.PutLog("Debug" 0 "Test Debug LOG");


Name
Comment
Security CodeCAPTCHA Image

easy tracking
avis car rental discount code

This page took 0.059196 seconds to load.