I explained what is Nlog library and how to use it and how to implement it in a code of C#
This is very simple and easy to understand also write some multiple choise question for your knowledge
Unleash Your Potential - Namagunga Girls Coding Club
Use of Nlog library in c#
1. Use of Nlog library in C#
Name Muhammad Zahid Ayub
Roll #: Bcsf15a009
Punjab University College of information Technology Lahore
2. What is Nlog ?
Nlog is an open source log platform. Through this platform, we
can log an activity of an application. This makes an application's
code easy to handle. Nlog provides a cross platform support.
It is extremely powerful, and very easy to setup.
With NLog you can easily write debug info to:
– files
– event log
– database
– network
– email
– command line console
– and many other providers
Multiple Choise Question about Nlog libraryin c#
(1)- If youwouldlike toretrieve aparticularlogger, thenwhich methodof the LogManagerclassyou
choose ?
(a) Loggerlogger= LogManager.GetLogger("SpecifyTheClassNameHere");
(b) Loggerlogger= LogManager.Get("SpecifyTheClassNameHere");
(c) None
Q2: whatdoesFallBackGroupinwrapper
(A) Fallback-on-errors (B) fullback-on-information
( c) fallback-on-exception (D) Both A,B
Q3: NLogsupportsspecial kindsof targetswhichdonot doany loggingbythemselves,butwhich
modifythe behaviorof otherloggers.Those targetsare called ??
3. (a)Wrappers (b) logs (c) classes
Q4: whatis trace ?
(a)verydetailedlogs (b)verydetailedlogs (c) nonof these
Q5: One can alsospecifyanexplicitname byusingNLog.LogManager. ??
(a) GetLogger("MyLogger"). (b) GetLogger(MyLoggr).
(c)none
Q6: One thingthat mayseemstrange isthat if NLog itself hasanexception,the loggingwill ??
(a) fail passively (b) pass passively
(b) nothing
Q 7: whatthingswe shouldinstall if youwatntouse nloglibrary
(a) nlog (b)nlog.config
(b) Both
Q8: Howto Log ASP.NETRequestDetails
(a) The NLog extensionspackage NLog.WebaddssupportforloggingASP.NETrequestfieldstoyour
logs.
(b) The NLog extensionspackage NLog.configaddssupportforloggingASP.NETrequestfieldsto
your logs.
(c) None
Q9: How to Correlate LogMessagesby WebRequestTransaction
(a) ${activityid}
(b) ID
(c) Both maybe
Q10: Using GDC, MDC, and MDLC isvirtuallyall the ??
(a) Same
(b) Different
(c) shareable Properties
Q11: NLog can support_______targets whichrepresentwhere yourlog_______is to be writtento.
(a) Multiple,error
(b) Error,multiple
4. (c) Multiple,data
Q12: You Can Make Your OwnCustomNLogTargets
(a) True (b) false
Q13 : Use _____ to SuppressCertainLoggingStatements
(a) Filters
(b) Log
(c) Data
Q 14 : Alwaysdefine aLoggerobjectasstatic
(A) true
(B) FALSE
(C) incomplete information
Q15: what are the targets???
(a) Targetsare howyou directwhere youwantyourlogs sent
(b) Targetsare howyou directwhere youwantyourlogs receive
(c) Incomplete data
Q16 : howcan we install nloglibraryinourproject??
(a) nuGetpackage
(b) Get package
(c) Alreadyinstalled
Q17 : Trying toquerylogsin SQL isvery_____if youlog anyreal volume of dataif you don’thave full-
textindexing.
(a) Fast
(b) Slow
(c) Error occurs