Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Enterprise Tools / April 2004

Tip: Looking for answers? Try searching our database.

EIF Publisher and EventPublishLogLevel 5?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howard Pinsley - 20 Apr 2004 19:10 GMT
I am EIF publisher of the Logging Block in conjunction with the
Exception Managment block.  It seems that when I call
ExceptionManager.Publish, the EIF logs and ErrorMessageEvent and sets
the EventPublishLogLevel at 5 (debug)?  Shouldn't it be set to level
Error.  As it stands now, if I publish an error, it won't log unless I
set the application event level to debug.  Am I missing something?
This sounds counter-intuitive.
Tian Min Huang - 21 Apr 2004 07:28 GMT
Hello,

Thanks for your post. I reviewed your description carefully, however, I am
not quite sure what your concern is exactly. I think more information is
needed before moving forward:

1. Which EventPublishLogLevel and ApplicationLogLevel do you set? Were you
debugging the program?

2. If you publish an error, you can also set Log Level to Error in order
lot it. That is, there is no need to set it to Debug. It's true that all
messages will be logged with Debug log level. But all the errors and
exceptions raised by the application will also be logged when setting Log
Level to Error. I strongly recommend you the following article on Logging
Block Design:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/
Logging-CH02.asp?frame=true

I look forward to your response.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Howard Pinsley - 21 Apr 2004 22:21 GMT
Tian:

Thank you very much for your response and concern.  See my answers
inline.

> 1. Which EventPublishLogLevel and ApplicationLogLevel do you set? Were you
> debugging the program?

I'm setting ApplicationLogLevel in app.config manually.
EventPublishLogLevel is being set in the call to EventManager.Publish.
Remember that I am using the EIFExceptionPublisher which is a special
exception publisher that works with the logging block.  This is how I
enable it in my app.config:

<exceptionManagement mode="on">
<publisher assembly="Microsoft.ApplicationBlocks.Logging.EIFPublisher"
type="Microsoft.ApplicationBlocks.Logging.EIFPublisher.EIFExceptionPublisher"
include="*" />
</exceptionManagement>

> 2. If you publish an error, you can also set Log Level to Error in order
> lot it. That is, there is no need to set it to Debug. It's true that all
[quoted text clipped - 5 lines]
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/
> Logging-CH02.asp?frame=true

I've read that article and more -- but perhaps I missed something.
How does one set the EventPublishLogLevel when the only call I am
making is:

ExceptionManager.Publish(string Msg)?

At that point, the EIFExceptionPublisher logs an ErrorMessageEvent and
sets the EventPublishLogLevel to 5 (debug).  I see no opportunity to
override that.

Thanks for you help and insight.  I've included the complete
ErrorMessageEvent as it appears in my trace log.  Note that the
EIFExceptionPublisher puts all the exception info that the Exception
Management Application Block generates within the "Message" property
of the ErrorMessageEvent.  Note also -- at the end -- the
EventPublishLogLevel of 5.

Microsoft.ApplicationBlocks.Logging.Schema.ErrorMessageEvent
{
  String Message = "
General Information
*********************************************
Additional Info:
ExceptionManager.MachineName: PHAETON
ExceptionManager.TimeStamp: 4/21/2004 5:02:56 PM
ExceptionManager.FullName:
Microsoft.ApplicationBlocks.ExceptionManagement,
Version=1.0.1536.23866, Culture=neutral, PublicKeyToken=null
ExceptionManager.AppDomainName: KSURLawCaseManager.exe
ExceptionManager.ThreadIdentity:
ExceptionManager.WindowsIdentity: KSFHH\pinsley

1) Exception Information
*********************************************
Exception Type: Microsoft.ApplicationBlocks.ExceptionManagement.BaseApplicationException
<redacted>
StackTrace Information
*********************************************
  at KSURLawCaseManager.FrmMain..ctor()"
  String ErrorCode = ""
  Int32 Severity = 0
  Int32 ProcessID = 1432
  String ProcessName =
"C:\Source\LitSup\URLawUtils\KSURLawCaseManager\bin\Release\KSURLawCaseManager.exe"
  String ThreadName = ""
  ComPlusInfo ComPlus = {
     String ActivityID = ""
     String ApplicationID = ""
     String TransactionID = ""
     String DirectCaller = ""
     String OriginalCaller = ""
  }
  WindowsSecurityInfo WindowsSecurity = {
<redacted>
  }
  ManagedSecurityInfo ManagedSecurity = {
     String IdentityName = ""
     String AuthenticationType = ""
     Boolean IsAuthenticated = False
  }
  String StackTrace = "    at
Microsoft.ApplicationBlocks.Logging.Schema.ErrorMessageEvent.Raise(EventSource
eventSource, String message, Int32 severity, String errorCode)
    at Microsoft.ApplicationBlocks.Logging.Schema.ErrorMessageEvent.Raise(String
message, Int32 severity, String errorCode)
    at Microsoft.ApplicationBlocks.Logging.EIFPublisher.EIFExceptionPublisher.Publish(Exception
exception, NameValueCollection additionalInfo, NameValueCollection
configSettings)
    at Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.PublishToCustomPublisher(Exception
exception, NameValueCollection additionalInfo, PublisherSettings
publisher)
    at Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception
exception, NameValueCollection additionalInfo)
    at Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception
exception)
    at KSURLawCaseManager.FrmMain..ctor()
    at KSURLawCaseManager.FrmMain.Main()"
  String ApplicationName = <null>
  String EventSourceInstance = "824f1650-969c-4bdb-8f71-02af828196ba"
  String EventId = "e19f8ced-fbac-4457-8798-8df36ec2d964"
  String EventSourceName = "Application"
  Int64 EventSequenceNumber = 1
  String EventSchemaVersion = "1.0.0.0"
  DateTime TimeStamp = 4/21/2004 9:02:57 PM
  String AppDomainName = "KSURLawCaseManager.exe"
  String MachineName = "PHAETON"
  String RootRequestName = ""
  String RootRequestInstance = ""
  String RequestInstance = ""
  String RequestName = ""
  Int64 RequestSequenceNumber = 0
  Int32 EventLogEntryTypeID = 1
  Boolean PopulatingEventInfoForFirstTime = False
  Int32 ApplicationLogLevel = 5
  Int32 EventPublishLogLevel = 5
  String FormatterName = <null>
}
Tian Min Huang - 27 Apr 2004 02:22 GMT
Hi,

Thanks for your response. I am checking this issue and will update you with
my information.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.