You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
2.7 KiB
JavaScript
1 line
2.7 KiB
JavaScript
12 months ago
|
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[2569],{8065:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>s,contentTitle:()=>l,default:()=>g,frontMatter:()=>a,metadata:()=>i,toc:()=>c});var t=n(5893),r=n(1151);const a={id:"log",title:"16. Log \u9759\u6001\u7c7b",sidebar_label:"16. Log \u9759\u6001\u7c7b"},l=void 0,i={id:"global/log",title:"16. Log \u9759\u6001\u7c7b",description:"\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 Furion 4.2.1 + \u7248\u672c\u4f7f\u7528\u3002",source:"@site/docs/global/log.mdx",sourceDirName:"global",slug:"/global/log",permalink:"/docs/global/log",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/global/log.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1661834024,formattedLastUpdatedAt:"Aug 30, 2022",frontMatter:{id:"log",title:"16. Log \u9759\u6001\u7c7b",sidebar_label:"16. Log \u9759\u6001\u7c7b"},sidebar:"global",previous:{title:"15. TP \u9759\u6001\u7c7b",permalink:"/docs/global/tp"},next:{title:"17. Schedular \u9759\u6001\u7c7b",permalink:"/docs/global/schedular"}},s={},c=[{value:"16.1 \u5e38\u89c1\u64cd\u4f5c",id:"161-\u5e38\u89c1\u64cd\u4f5c",level:2}];function d(e){const o={admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,t.jsxs)(o.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,t.jsx)(o.code,{children:"Furion 4.2.1 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,t.jsx)(o.h2,{id:"161-\u5e38\u89c1\u64cd\u4f5c",children:"16.1 \u5e38\u89c1\u64cd\u4f5c"}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.code,{className:"language-cs",metastring:"showLineNumbers {2,5,10-15}",children:'// \u521b\u5efa\u65e5\u5fd7\u5bf9\u8c61\r\nvar logger = Log.CreateLogger("\u65e5\u5fd7\u540d\u79f0");\r\n\r\n// \u521b\u5efa\u65e5\u5fd7\u5de5\u5382\r\nusing var loggerFactory = Log.CreateLoggerFactory(builder => {\r\n // ....\r\n});\r\n\r\n// \u65e5\u5fd7\u8bb0\u5f55\r\nLog.Information("Information");\r\nLog.Warning("Warning");\r\nLog.Error("Error");\r\nLog.Debug("Debug");\r\nLog.Trace("Trace");\r\nLog.Critical("Critical");\n'})})]})}function g(e={}){const{wrapper:o}={...(0,r.a)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},1151:(e,o,n)=>{n.d(o,{Z:()=>i,a:()=>l});var t=n(7294);const r={},a=t.createContext(r);function l(e){const o=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function i(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),t.createElement(a.Provider,{value:o},e.children)}}}]);
|