mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-27 19:24:47 +03:00
add request logging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Services;
|
||||
using ServiceStack.Host;
|
||||
|
||||
@@ -9,12 +10,16 @@ namespace ServiceStack
|
||||
public class HttpHandlerFactory
|
||||
{
|
||||
// Entry point for HttpListener
|
||||
public static RestHandler GetHandler(IHttpRequest httpReq)
|
||||
public static RestHandler GetHandler(IHttpRequest httpReq, ILogger logger)
|
||||
{
|
||||
var pathInfo = httpReq.PathInfo;
|
||||
|
||||
var pathParts = pathInfo.TrimStart('/').Split('/');
|
||||
if (pathParts.Length == 0) return null;
|
||||
if (pathParts.Length == 0)
|
||||
{
|
||||
logger.Error("Path parts empty for PathInfo: {0}, Url: {1}", pathInfo, httpReq.RawUrl);
|
||||
return null;
|
||||
}
|
||||
|
||||
string contentType;
|
||||
var restPath = RestHandler.FindMatchingRestPath(httpReq.HttpMethod, pathInfo, out contentType);
|
||||
|
||||
Reference in New Issue
Block a user