Spędziłem dzień próbując zrobić Ent Lib Logging i logować wszystko do bazy danych lub dziennika zdarzeń. Mam aplikację internetową i aplikację konsolową z tą samą konfiguracją Ent Lib, ale tylko aplikacja konsoli może zalogować się do dziennika zdarzeń. Próbowałem wszystkiego z uprawnieniami, ale nie wiem, co dokładnie robię, które usługi powinny mieć co. To nie działa!Enterprise Library Logging nie loguje się do dziennika zdarzeń z ASP.NET
Czytam artykuły takie jak ten http://imar.spaanjaars.com/275/logging-errors-to-the-event-log-in-aspnet-applications i chcę spróbować dać konto ASPNET te uprawnienia. Używam Windows 7 i nie mogę znaleźć konta użytkownika ASPNET. Więc gdzie to jest?
Jest to plik konfiguracyjny, który generowany jest automatycznie użyteczności Ent Lib i działa tylko na app.config, a nie na web.config
<loggingConfiguration name="Logging Application Block" tracingEnabled="true"
defaultCategory="General" logWarningsWhenNoCategoriesMatch="true"
revertImpersonation="false">
<listeners>
<add source="Logger" formatter="Text Formatter" log="Application"
machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Formatted EventLog TraceListener" />
</listeners>
<formatters>
<add template="Timestamp: {timestamp}
Message: {message}
Category: {category}
Priority: {priority}
EventId: {eventid}
Severity: {severity}
Title:{title}
Machine: {machine}
Application Domain: {appDomain}
Process Id: {processId}
Process Name: {processName}
Win32 Thread Id: {win32ThreadId}
Thread Name: {threadName}
Extended Properties: {dictionary({key} - {value}
)}"
type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Text Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="Formatted EventLog TraceListener" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events" />
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="Formatted EventLog TraceListener" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
Czy możesz opublikować odpowiednie części swojej konfiguracji? Czy WebApp i ConsoleApp działają na tym samym komputerze? – RoelF
Tak, WebApp i ConsolApp działają na tej samej maszynie – Costa
"Próbowałem wszystkiego z uprawnieniami" - czego próbowałeś? –