Logging to files or to event viewer?

I was wondering what is the 'correct' way to log information messages; to files, or to a special log in the event viewer?

I like logging to files since I can use rolling flat file listener and see fresh new log from each day, plus in the event viewer I can only see one message at a time - where in a file I can scan through the day much easily. My colleague argues that files just take up space and he likes having his warnings, errors and information messages all in one place. What do you think? Is there a preferred way? If so, why?

Also, are there any concurrency issues in any of the methods? I have read that entlib is thread-safe and generates a Monitor.Enter behind if the listener is not thread safe, but I want to make sure (we're just using Logger.Write). We are using entlib 3.1.

Thank you in advance.

8
задан Rita 29 August 2010 в 22:00
поделиться

1 ответ

Нет "правильного" пути. Это зависит от ваших требований.

Вам «нравится» смотреть на плоские файлы, но сколько (тысяч) строк вы действительно можете читать каждый день?

Похоже, что вам нужен план (политика), который должен включать некоторые инструменты. Спросите себя, как быстро вы заметите аномалию в журналах? А отсутствие чего-то нормального?

Журнал событий немного больше работы/накладных расходов, но его можно легко контролировать удаленно (несколько серверов) с помощью какого-либо инструмента. Если вы используете (только) ручную проверку, не беспокойтесь.

3
ответ дан 5 December 2019 в 15:16
поделиться
Другие вопросы по тегам:

Похожие вопросы: