Skip to content

ASP.NET Core MVC のアクセスログ出力点が net48 より少ない(View() / OnResultExecuting / OnResultExecuted の移植漏れの可能性) #509

Description

@OsscJpDevInfra

概要

アクセスログの出力点が net48 版と Core 版で食い違っている。

ログ出力点
net48 MyBaseMVController 7つOnActionExecuting(----->) / OnActionExecuted(<-----) / View(IView, object)(----->>) / View(string, string, object)(----->>) / OnResultExecuting(----->, Debug) / OnResultExecuted(<-----, Debug) / OnException(<-----, Error)
Core MyBaseMVControllerCore 3つOnActionExecutionAsync の前後(-----> / <-----)と MyMVCCoreFilterAttribute.OnException

Core では View() / OnResultExecuting / OnResultExecuted に相当する出力点が無い。

実害

ビューのレンダリング区間がアクセスログに出ず、性能測定の粒度が粗くなる。

移植漏れと見られる根拠

  1. net48 の漏斗(View(IView, object) / View(string, string, object))は Core に対応オーバーロードが無く(マスタページ概念が無い)、機械的移植では落ちやすい。
  2. OnActionExecuting/Executed は Core 側でコメントアウト+「OnActionExecutionAsyncに移行」と理由が明記されるのに、View() / OnResultExecuting / OnResultExecuted は跡形が無い。ヘッダのイベント順コメントには列挙されているのに実装だけが無い。
  3. net48 は 2015〜2017 に段階的にログ出力点が増えた履歴があるが、Core は 2018/04/19 の新規作成でその積み上げを引き継いでいない。

期待する挙動

Core MVC でもレンダリング/結果実行の区間を含め、net48 と同等の出力点でアクセスログを出す
MyMVCCoreFilterAttributeActionFilterAttribute を継承しており OnResultExecuting/Executed を実装可能)。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions