[{"data":1,"prerenderedAt":725},["ShallowReactive",2],{"content-zh-TW-migration":3},{"doc":4,"debug":655},{"id":5,"title":6,"body":7,"description":648,"extension":649,"meta":650,"navigation":404,"path":651,"seo":652,"stem":653,"__hash__":654},"content\u002Fzh-TW\u002Fmigration.md","升級指南",{"type":8,"value":9,"toc":629},"minimark",[10,24,53,66,69,74,81,104,107,142,150,153,168,183,188,192,203,256,260,265,268,293,299,320,323,335,338,353,360,369,377,380,438,442,445,474,481,489,504,508,511,594,598,607,614,618,625],[11,12,14,15,19,20,23],"h1",{"id":13},"升級指南-ozakboynlog-v2x-ozalog-v30","升級指南 — ",[16,17,18],"code",{},"Ozakboy.NLOG"," v2.x → ",[16,21,22],{},"OzaLog"," v3.0",[25,26,27],"blockquote",{},[28,29,30,34,35,37,38,47,48,52],"p",{},[31,32,33],"strong",{},"為何改名？"," ",[16,36,18],{}," 與知名套件 ",[39,40,44],"a",{"href":41,"rel":42},"https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FNLog",[43],"nofollow",[16,45,46],{},"NLog"," 完全無關,但名稱相近常造成使用者混淆。v3.0 改名為 ",[31,49,50],{},[16,51,22],{}," 一次解決,並標記 v3.0 架構大改寫的明確分界。",[25,54,55],{},[28,56,57,62,63,65],{},[31,58,59,61],{},[16,60,18],{}," v2.1.0 已棄用",",不再更新。所有後續開發都在 ",[16,64,22],{},"。",[67,68],"hr",{},[70,71,73],"h2",{"id":72},"_1-更新-nuget-packagereference","1. 更新 NuGet PackageReference",[28,75,76,77,80],{},"在您的 ",[16,78,79],{},".csproj",":",[82,83,88],"pre",{"className":84,"code":85,"language":86,"meta":87,"style":87},"language-diff shiki shiki-themes github-light","- \u003CPackageReference Include=\"Ozakboy.NLOG\" Version=\"2.1.0\" \u002F>\n+ \u003CPackageReference Include=\"OzaLog\" Version=\"3.0.0\" \u002F>\n","diff","",[16,89,90,98],{"__ignoreMap":87},[91,92,95],"span",{"class":93,"line":94},"line",1,[91,96,97],{},"- \u003CPackageReference Include=\"Ozakboy.NLOG\" Version=\"2.1.0\" \u002F>\n",[91,99,101],{"class":93,"line":100},2,[91,102,103],{},"+ \u003CPackageReference Include=\"OzaLog\" Version=\"3.0.0\" \u002F>\n",[28,105,106],{},"或透過 CLI:",[82,108,112],{"className":109,"code":110,"language":111,"meta":87,"style":87},"language-bash shiki shiki-themes github-light","dotnet remove package Ozakboy.NLOG\ndotnet add package OzaLog\n","bash",[16,113,114,130],{"__ignoreMap":87},[91,115,116,120,124,127],{"class":93,"line":94},[91,117,119],{"class":118},"s7eDp","dotnet",[91,121,123],{"class":122},"sYBdl"," remove",[91,125,126],{"class":122}," package",[91,128,129],{"class":122}," Ozakboy.NLOG\n",[91,131,132,134,137,139],{"class":93,"line":100},[91,133,119],{"class":118},[91,135,136],{"class":122}," add",[91,138,126],{"class":122},[91,140,141],{"class":122}," OzaLog\n",[70,143,145,146,149],{"id":144},"_2-更新-using-陳述式","2. 更新 ",[16,147,148],{},"using"," 陳述式",[28,151,152],{},"在程式碼中全域取代:",[82,154,156],{"className":84,"code":155,"language":86,"meta":87,"style":87},"- using ozakboy.NLOG;\n+ using OzaLog;\n",[16,157,158,163],{"__ignoreMap":87},[91,159,160],{"class":93,"line":94},[91,161,162],{},"- using ozakboy.NLOG;\n",[91,164,165],{"class":93,"line":100},[91,166,167],{},"+ using OzaLog;\n",[82,169,171],{"className":84,"code":170,"language":86,"meta":87,"style":87},"- using ozakboy.NLOG.Core;\n+ using OzaLog.Core;\n",[16,172,173,178],{"__ignoreMap":87},[91,174,175],{"class":93,"line":94},[91,176,177],{},"- using ozakboy.NLOG.Core;\n",[91,179,180],{"class":93,"line":100},[91,181,182],{},"+ using OzaLog.Core;\n",[25,184,185],{},[28,186,187],{},"提示:單次專案範圍的「尋找與取代」即可處理。上面兩個 pattern 涵蓋所有引用。",[70,189,191],{"id":190},"_3-公開-api-完全沒變","3. 公開 API 完全沒變",[28,193,194,195,198,199,202],{},"您",[31,196,197],{},"不需要","修改任何 ",[16,200,201],{},"LOG.*_Log(...)"," 呼叫。所有公開方法簽章都保留:",[82,204,208],{"className":205,"code":206,"language":207,"meta":87,"style":87},"language-csharp shiki shiki-themes github-light","LOG.Trace_Log(\"...\");\nLOG.Debug_Log(\"...\");\nLOG.Info_Log(\"...\");\nLOG.Warn_Log(\"...\");\nLOG.Error_Log(\"...\");\nLOG.Fatal_Log(\"...\");\nLOG.CustomName_Log(\"BTC\", \"...\");\nLOG.Configure(o => { ... });\n","csharp",[16,209,210,215,220,226,232,238,244,250],{"__ignoreMap":87},[91,211,212],{"class":93,"line":94},[91,213,214],{},"LOG.Trace_Log(\"...\");\n",[91,216,217],{"class":93,"line":100},[91,218,219],{},"LOG.Debug_Log(\"...\");\n",[91,221,223],{"class":93,"line":222},3,[91,224,225],{},"LOG.Info_Log(\"...\");\n",[91,227,229],{"class":93,"line":228},4,[91,230,231],{},"LOG.Warn_Log(\"...\");\n",[91,233,235],{"class":93,"line":234},5,[91,236,237],{},"LOG.Error_Log(\"...\");\n",[91,239,241],{"class":93,"line":240},6,[91,242,243],{},"LOG.Fatal_Log(\"...\");\n",[91,245,247],{"class":93,"line":246},7,[91,248,249],{},"LOG.CustomName_Log(\"BTC\", \"...\");\n",[91,251,253],{"class":93,"line":252},8,[91,254,255],{},"LOG.Configure(o => { ... });\n",[70,257,259],{"id":258},"_4-破壞性變更務必詳讀","4. 破壞性變更(務必詳讀)",[261,262,264],"h3",{"id":263},"_41-移除部分-targetframeworks","4.1 移除部分 TargetFrameworks",[28,266,267],{},"OzaLog v3.0 支援:",[269,270,271,282],"ul",{},[272,273,274,275,278,279],"li",{},"✅ ",[16,276,277],{},"netstandard2.0"," \u002F ",[16,280,281],{},"netstandard2.1",[272,283,274,284,278,287,278,290],{},[16,285,286],{},"net8.0",[16,288,289],{},"net9.0",[16,291,292],{},"net10.0",[28,294,295,296,80],{},"OzaLog v3.0 ",[31,297,298],{},"移除",[269,300,301,308,314],{},[272,302,303,304,307],{},"❌ ",[16,305,306],{},".NET Framework 4.6.2"," — 若需 .NET Framework 請繼續使用 Ozakboy.NLOG v2.1.0",[272,309,303,310,313],{},[16,311,312],{},"net6.0","(微軟已於 2024-11 停止支援)",[272,315,303,316,319],{},[16,317,318],{},"net7.0","(微軟已於 2024-05 停止支援)",[28,321,322],{},"若仍在 .NET 6\u002F7,請先升級至 net8 LTS。",[261,324,326,327,330,331,334],{"id":325},"_42-loglevelcostomname-loglevelcustomname拼字修正","4.2 ",[16,328,329],{},"LogLevel.CostomName"," → ",[16,332,333],{},"LogLevel.CustomName","(拼字修正)",[28,336,337],{},"Enum 值名稱原本是拼錯的,v3.0 修正:",[82,339,341],{"className":84,"code":340,"language":86,"meta":87,"style":87},"- LogLevel.CostomName\n+ LogLevel.CustomName\n",[16,342,343,348],{"__ignoreMap":87},[91,344,345],{"class":93,"line":94},[91,346,347],{},"- LogLevel.CostomName\n",[91,349,350],{"class":93,"line":100},[91,351,352],{},"+ LogLevel.CustomName\n",[28,354,355,356,359],{},"數值(",[16,357,358],{},"99",")未變,因此 wire-format \u002F 序列化表示仍維持相容。",[25,361,362],{},[28,363,364,365,368],{},"99% 使用者不會直接接觸這個 enum(公開 API 是 ",[16,366,367],{},"LOG.CustomName_Log(...)",",本就拼對)。若您有直接引用 enum 值,請更新。",[261,370,372,373,376],{"id":371},"_43-新增-logoptions-屬性增量非破壞","4.3 新增 ",[16,374,375],{},"LogOptions"," 屬性(增量,非破壞)",[28,378,379],{},"不需要的話可以忽略:",[82,381,383],{"className":205,"code":382,"language":207,"meta":87,"style":87},"LOG.Configure(o =>\n{\n    \u002F\u002F ... 既有選項 ...\n\n    \u002F\u002F v3.0 新增\n    o.EnableGlobalExceptionCapture = false;   \u002F\u002F 預設 false;啟用 AppDomain 全域意外處理\n    o.MaxOpenFileStreams = 100;               \u002F\u002F LRU 上限(預設 100)\n    o.DiskFlushIntervalMs = 100;              \u002F\u002F 落盤間隔(預設 100ms)\n    o.OnDropped = () => { \u002F* counter *\u002F };    \u002F\u002F 背壓 callback\n});\n",[16,384,385,390,395,400,406,411,416,421,426,432],{"__ignoreMap":87},[91,386,387],{"class":93,"line":94},[91,388,389],{},"LOG.Configure(o =>\n",[91,391,392],{"class":93,"line":100},[91,393,394],{},"{\n",[91,396,397],{"class":93,"line":222},[91,398,399],{},"    \u002F\u002F ... 既有選項 ...\n",[91,401,402],{"class":93,"line":228},[91,403,405],{"emptyLinePlaceholder":404},true,"\n",[91,407,408],{"class":93,"line":234},[91,409,410],{},"    \u002F\u002F v3.0 新增\n",[91,412,413],{"class":93,"line":240},[91,414,415],{},"    o.EnableGlobalExceptionCapture = false;   \u002F\u002F 預設 false;啟用 AppDomain 全域意外處理\n",[91,417,418],{"class":93,"line":246},[91,419,420],{},"    o.MaxOpenFileStreams = 100;               \u002F\u002F LRU 上限(預設 100)\n",[91,422,423],{"class":93,"line":252},[91,424,425],{},"    o.DiskFlushIntervalMs = 100;              \u002F\u002F 落盤間隔(預設 100ms)\n",[91,427,429],{"class":93,"line":428},9,[91,430,431],{},"    o.OnDropped = () => { \u002F* counter *\u002F };    \u002F\u002F 背壓 callback\n",[91,433,435],{"class":93,"line":434},10,[91,436,437],{},"});\n",[261,439,441],{"id":440},"_44-內部架構大改寫對您透明","4.4 內部架構大改寫(對您透明)",[28,443,444],{},"內部已重寫為 HFT 級吞吐:",[269,446,447,457,464,471],{},[272,448,449,452,453,456],{},[16,450,451],{},"LogItem"," 改為 ",[16,454,455],{},"readonly struct","(零 GC 壓力)",[272,458,459,460,463],{},"持久化 ",[16,461,462],{},"FileStream"," 池含 LRU 淘汰",[272,465,466,467,470],{},"時間戳每 1 ms 快取一次(避免 ",[16,468,469],{},"DateTime.Now"," syscall)",[272,472,473],{},"隊列滿時改 drop-oldest 背壓(舊版:降級為同步寫入)",[28,475,476,477,480],{},"若您先前依賴「隊列滿 → 呼叫端在同步寫上阻塞」這個實作細節,請注意新版改為「隊列滿 → 丟棄最舊 log 繼續執行」。需追蹤丟棄數量請使用 ",[16,478,479],{},"OnDropped"," callback。",[261,482,484,485,488],{"id":483},"_45-consolewriteline-雙重格式化-bug-修正","4.5 ",[16,486,487],{},"Console.WriteLine"," 雙重格式化 bug 修正",[28,490,491,492,495,496,499,500,503],{},"v2.x 中,若啟用 console 輸出且格式化後訊息恰好含有額外的 ",[16,493,494],{},"{N}"," placeholder,",[16,497,498],{},"LOG.Info_Log(\"含 {0} 的訊息\", args)"," 可能丟出 ",[16,501,502],{},"FormatException","。v3.0 已修正。",[70,505,507],{"id":506},"_5-檔案-資料夾改名資訊用","5. 檔案 \u002F 資料夾改名(資訊用)",[28,509,510],{},"若您 clone 了原始 repo:",[512,513,514,527],"table",{},[515,516,517],"thead",{},[518,519,520,524],"tr",{},[521,522,523],"th",{},"v2.x",[521,525,526],{},"v3.0",[528,529,530,543,556,569,581],"tbody",{},[518,531,532,538],{},[533,534,535],"td",{},[16,536,537],{},"ozakboy.NLOG\u002Fozakboy.NLOG\u002Fozakboy.NLOG.sln",[533,539,540],{},[16,541,542],{},"OzaLog\u002FOzaLog.sln",[518,544,545,551],{},[533,546,547,550],{},[16,548,549],{},"ozakboy.NLOG\u002Fozakboy.NLOG\u002F","(solution 資料夾)",[533,552,553],{},[16,554,555],{},"OzaLog\u002F",[518,557,558,564],{},[533,559,560,563],{},[16,561,562],{},"ozakboy.NLOG\u002Fozakboy.NLOG\u002Fozakboy.NLOG\u002F","(專案資料夾)",[533,565,566],{},[16,567,568],{},"OzaLog\u002FOzaLog\u002F",[518,570,571,576],{},[533,572,573],{},[16,574,575],{},"ozakboy.NLOG.csproj",[533,577,578],{},[16,579,580],{},"OzaLog.csproj",[518,582,583,589],{},[533,584,585,588],{},[16,586,587],{},"NLOG.cs","(檔名)",[533,590,591],{},[16,592,593],{},"LOG.cs",[70,595,597],{"id":596},"_6-暫時無法升級怎麼辦","6. 暫時無法升級怎麼辦",[28,599,600,602,603,606],{},[16,601,18],{}," v2.1.0 仍會留在 NuGet 上(會標 deprecated 並指向 OzaLog),既有專案可繼續安裝執行。",[31,604,605],{},"v2.x 不會再有任何更新——包含 security patch","。若您需要修正,唯一路徑是 OzaLog v3.0+。",[28,608,609,610,613],{},"git tag ",[16,611,612],{},"v2-frozen"," 標記 repo 中 v2.x 的最終狀態。",[70,615,617],{"id":616},"_7-需要協助","7. 需要協助?",[28,619,620,621],{},"開 issue: ",[39,622,623],{"href":623,"rel":624},"https:\u002F\u002Fgithub.com\u002Fozakboy\u002FOzaLog\u002Fissues",[43],[626,627,628],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}",{"title":87,"searchDepth":100,"depth":222,"links":630},[631,632,634,635,645,646,647],{"id":72,"depth":100,"text":73},{"id":144,"depth":100,"text":633},"2. 更新 using 陳述式",{"id":190,"depth":100,"text":191},{"id":258,"depth":100,"text":259,"children":636},[637,638,640,642,643],{"id":263,"depth":222,"text":264},{"id":325,"depth":222,"text":639},"4.2 LogLevel.CostomName → LogLevel.CustomName(拼字修正)",{"id":371,"depth":222,"text":641},"4.3 新增 LogOptions 屬性(增量,非破壞)",{"id":440,"depth":222,"text":441},{"id":483,"depth":222,"text":644},"4.5 Console.WriteLine 雙重格式化 bug 修正",{"id":506,"depth":100,"text":507},{"id":596,"depth":100,"text":597},{"id":616,"depth":100,"text":617},"從 Ozakboy.NLOG v2.x 升級至 OzaLog v3.0。","md",{},"\u002Fzh-tw\u002Fmigration",{"title":6,"description":648},"zh-TW\u002Fmigration","FH0YBb3hw3XPonYiFXkXhQRSWMffXN52pO_xPBCK-iI",{"matched":656,"target":657,"all":658},"fallback (.all() + manual match)","\u002Fzh-TW\u002Fmigration",[659,664,669,674,679,684,689,694,699,704,709,714,719,724],{"path":660,"id":661,"stem":662,"title":663},"\u002Fen\u002Fapi","content\u002Fen\u002Fapi.md","en\u002Fapi","API Reference",{"path":665,"id":666,"stem":667,"title":668},"\u002Fen\u002Fasync-pipeline","content\u002Fen\u002Fasync-pipeline.md","en\u002Fasync-pipeline","HFT Async Architecture",{"path":670,"id":671,"stem":672,"title":673},"\u002Fen\u002Fbenchmarks","content\u002Fen\u002Fbenchmarks.md","en\u002Fbenchmarks","Benchmarks",{"path":675,"id":676,"stem":677,"title":678},"\u002Fen\u002Fchangelog","content\u002Fen\u002Fchangelog.md","en\u002Fchangelog","Changelog",{"path":680,"id":681,"stem":682,"title":683},"\u002Fen\u002Fconfiguration","content\u002Fen\u002Fconfiguration.md","en\u002Fconfiguration","Configuration",{"path":685,"id":686,"stem":687,"title":688},"\u002Fen\u002Fgetting-started","content\u002Fen\u002Fgetting-started.md","en\u002Fgetting-started","Getting Started",{"path":690,"id":691,"stem":692,"title":693},"\u002Fen\u002Fmigration","content\u002Fen\u002Fmigration.md","en\u002Fmigration","Migration Guide",{"path":695,"id":696,"stem":697,"title":698},"\u002Fzh-tw\u002Fapi","content\u002Fzh-TW\u002Fapi.md","zh-TW\u002Fapi","API 參考",{"path":700,"id":701,"stem":702,"title":703},"\u002Fzh-tw\u002Fasync-pipeline","content\u002Fzh-TW\u002Fasync-pipeline.md","zh-TW\u002Fasync-pipeline","HFT 非同步架構",{"path":705,"id":706,"stem":707,"title":708},"\u002Fzh-tw\u002Fbenchmarks","content\u002Fzh-TW\u002Fbenchmarks.md","zh-TW\u002Fbenchmarks","效能對比",{"path":710,"id":711,"stem":712,"title":713},"\u002Fzh-tw\u002Fchangelog","content\u002Fzh-TW\u002Fchangelog.md","zh-TW\u002Fchangelog","版本歷史",{"path":715,"id":716,"stem":717,"title":718},"\u002Fzh-tw\u002Fconfiguration","content\u002Fzh-TW\u002Fconfiguration.md","zh-TW\u002Fconfiguration","配置選項",{"path":720,"id":721,"stem":722,"title":723},"\u002Fzh-tw\u002Fgetting-started","content\u002Fzh-TW\u002Fgetting-started.md","zh-TW\u002Fgetting-started","快速開始",{"path":651,"id":5,"stem":653,"title":6},1778734456089]