{"id":893,"date":"2011-02-23T14:35:27","date_gmt":"2011-02-23T05:35:27","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=893"},"modified":"2025-03-12T11:31:17","modified_gmt":"2025-03-12T02:31:17","slug":"vb-net%e3%81%aemy-application-log%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2011\/02\/23\/vb-net%e3%81%aemy-application-log%e3%82%92%e4%bd%bf%e3%81%86\/","title":{"rendered":"VB.NET\u306eMy.Application.Log\u3092\u4f7f\u3046"},"content":{"rendered":"<p><a href=\"http:\/\/dobon.net\/vb\/dotnet\/programing\/myapplicationlog.html\" target=\"_blank\">My.Application.Log\u3092\u4f7f\u7528\u3057\u3066\u30c8\u30ec\u30fc\u30b9\u3059\u308b\u3001\u30ed\u30b0\u306b\u66f8\u304d\u8fbc\u3080<\/a><br \/>\n\u3067\u8a73\u3057\u304f\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u30e1\u30e2\u7a0b\u5ea6\u3067\u3002<\/p>\n<p>\u307e\u305a\u3001My.Application.Log\u3092\u4f7f\u3046\u305f\u3081\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308bapp.config\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002\uff08\u306a\u3044\u5834\u5408\u306f[\u30d7\u30ed\u30b8\u30a7\u30af\u30c8] > [\u65b0\u3057\u3044\u9805\u76ee\u306e\u8ffd\u52a0]\u304b\u3089\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\uff09<br \/>\napp.config\u304c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u8ffd\u52a0\u3055\u308c\u305f\u6642\u70b9\u3067My.Application.Log\u306b\u95a2\u3059\u308b\u8a18\u8ff0\u304c\u3042\u308b\u306e\u3067\u697d\u3067\u3059\u3002<\/p>\n<pre lang=\"xml\" line=\"1\">\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n    <system.diagnostics>\n        <sources>\n            <!-- \u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001My.Application.Log \u306e\u30ed\u30b0\u69cb\u6210\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002 -->\n            <source name=\"DefaultSource\" switchName=\"DefaultSwitch\">\n                <listeners>\n                    <add name=\"FileLog\"\/>\n                    <!-- \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 \u30a4\u30d9\u30f3\u30c8 \u30ed\u30b0\u306b\u66f8\u304d\u8fbc\u3080\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u89e3\u9664\u3057\u307e\u3059 -->\n                    <!--<add name=\"EventLog\"\/>-->\n                <\/listeners>\n            <\/source>\n        <\/sources>\n        <switches>\n            <add name=\"DefaultSwitch\" value=\"Information\" \/>\n        <\/switches>\n        <sharedListeners>\n            <add name=\"FileLog\"\n                 type=\"Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" \n                 initializeData=\"FileLogWriter\"\/>\n            <!-- \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3 \u30a4\u30d9\u30f3\u30c8 \u30ed\u30b0\u306b\u66f8\u304d\u8fbc\u3080\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u30b3\u30e1\u30f3\u30c8\u3092\u89e3\u9664\u3057\u3066\u3001APPLICATION_NAME \u3092\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059 -->\n            <!--<add name=\"EventLog\" type=\"System.Diagnostics.EventLogTraceListener\" initializeData=\"APPLICATION_NAME\"\/> -->\n        <\/sharedListeners>\n    <\/system.diagnostics>\n<\/configuration>\n<\/pre>\n<p>\u3057\u304b\u3057\u3001\u3053\u306e\u307e\u307e\u4f55\u3082\u89e6\u3089\u305a\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u3067<\/p>\n<pre lang=\"vbnet\" line=\"1\">\nMy.Application.Log.WriteEntry(\"\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u521d\u671f\u5316\")\n\n&#039;Try\uff5eCatch\u5185\u306a\u3069\u3067\nMy.Application.Log.WriteException(New Exception(\"\u30a8\u30e9\u30fc\uff01\"))\n<\/pre>\n<p>\u3068\u3059\u308b\u3060\u3051\u3067\u3082<\/p>\n<pre lang=\"text\" line=\"1\">\nDefaultSource   Information 0   \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306e\u521d\u671f\u5316\nDefaultSource   Error   2   \u30a8\u30e9\u30fc\uff01\n<\/pre>\n<p>\u3068\u51fa\u529b\u3055\u308c\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u51fa\u529b\u5148\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306f<br \/>\n<b>\u30e6\u30fc\u30b6\u30fc\u306eApplication Data\u30d5\u30a9\u30eb\u30c0\\CompanyName\\ProductName\\ProductVersion\\ProductName.log<\/b><br \/>\n\u3067\u3059\u304c\u3001Vista\u4ee5\u964d\u306f\u30d5\u30a9\u30eb\u30c0\u69cb\u6210\u304c\u5909\u308f\u3063\u3066\u3044\u308b\u306e\u3067<br \/>\n<b>\u30e6\u30fc\u30b6\u30fc\u306eAppData\\Roaming\\CompanyName\\ProductName\\ProductVersion\\ProductName.log<\/b><br \/>\n\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F893&#038;t=VB.NET%E3%81%AEMy.Application.Log%E3%82%92%E4%BD%BF%E3%81%86&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F893&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=VB.NET%E3%81%AEMy.Application.Log%E3%82%92%E4%BD%BF%E3%81%86\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F893&#038;text=VB.NET%E3%81%AEMy.Application.Log%E3%82%92%E4%BD%BF%E3%81%86\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F893&#038;title=VB.NET%E3%81%AEMy.Application.Log%E3%82%92%E4%BD%BF%E3%81%86\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=VB.NET%E3%81%AEMy.Application.Log%E3%82%92%E4%BD%BF%E3%81%86&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F893\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=VB.NET%E3%81%AEMy.Application.Log%E3%82%92%E4%BD%BF%E3%81%86&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F893\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>My.Application.Log\u3092\u4f7f\u7528\u3057\u3066\u30c8\u30ec\u30fc\u30b9\u3059\u308b\u3001\u30ed\u30b0\u306b\u66f8\u304d\u8fbc\u3080 \u3067\u8a73\u3057\u304f\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u30e1\u30e2\u7a0b\u5ea6\u3067\u3002 \u307e\u305a\u3001My.Application.Log\u3092\u4f7f\u3046\u305f\u3081\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u3067\u3042\u308bapp.conf [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[54],"class_list":["post-893","post","type-post","status-publish","format-standard","hentry","category-1","tag-vb"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=893"}],"version-history":[{"count":17,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/893\/revisions"}],"predecessor-version":[{"id":4814,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/893\/revisions\/4814"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}