Code Monkey home page Code Monkey logo

commonlog's People

Contributors

tratcher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

steveteece

commonlog's Issues

User-Agent

I'm still using this, now for Blazor Server Side (initial requests and for watching static files requests) and I would like to get the "User-Agent", if this is possible with CommonLog? With the code below I am getting an empty string, Headers.Count = 0;

CommonLogMiddleware.cs (example)
public async Task Invoke(HttpContext httpContext)
...

RemoteHost = httpContext.Connection.RemoteIpAddress.ToString(),
UserAgent = httpContext.Response.Headers["User-Agent"].ToString(),

Update: @ me, myself & I: Response? Seriously??

Write results to a file and/or database

Hi Chris,

I've implemented your CommonLog middleware at ictz.net and it's running smoothly.

I've tried to add some code to log the results to a file, but I was thinking way too simple (!). that's needs more thought. I've looked at SeriLog and NetEscapades.Extensions.Logging.RollingFile but I like your code because it's small and easy to implement, and does exactly what I'd like it to do: Log Kestrel http requests in a "CommonLog" format.

I will look further how to log the results to a file and/or database, but if you've any thoughts on this, it's much appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.