Open Source .NET Development [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Open Source .NET Development [Electronic resources] - نسخه متنی

Brian Nantz

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


ObjectRenderer


When using a Logger in your application, you will notice that all Logger functions accept an Object for their message parameters. This takes advantage of the fact that all classes inherit from System.Object in .NET. Another reason for using an Object is for Log4Net to allow you to pass more than just a string to be logged. Log4Net gains a little code reuse by creating a class called ObjectRenderer. ObjectRenderer is used by the Layout class to transform the LoggingEvent into a string message to be logged. By implementing a custom ObjectRenderer, you can pass a custom Object to Log4Net, and the Layout will call your specified custom ObjectRenderer to get a String representation of the state of the Object. This is demonstrated using a DataSet in the "Examples"section of this chapter.


    / 275