← 输入框|github.com|刷新
Skip to content

Add a new server example, this time using the log function #14

Closed

Description

@glynos

Since Boost.Log has been formally accepted into boost (http://comments.gmane.org/gmane.comp.lib.boost.announce/257), I'd like to develop a server example that incorporates this.

Take the example in hello_world_server and implement the log member function.

Activity

  1. glynos commented on Apr 9, 2010

    @glynos
    MemberAuthor

    Nope, but do we need to wait for this? It might take a long time before it's part of a formal release, and I think it could be a useful example because users of cpp-netlib might also use the boost logging library.

    Furthermore, an example of the HTTP server with logging would be useful (even if it's only std::cerr).

  2. glynos commented on Apr 9, 2010

    @glynos
    MemberAuthor

    OK, I've updated the issue header.

  3. leisinmr commented on Aug 8, 2011

    @leisinmr

    I'm coming up to speed on the project and would like to take a stab at this one. I just took a look at Boost.log and it seem like it'd be pretty straightforward to implement.

  4. glynos commented on Aug 9, 2011

    @glynos
    MemberAuthor

    That would be great! I agree that the implementation would be straightforward. Do you already have an implementation in mind? If you have any questions, comments, ideas etc. please bring it up on the mailing list where you'll find a small (but growing) community who can help.

  5. leisinmr commented on Aug 11, 2011

    @leisinmr

    My plan was to add the multithreaded version of boost::log::sources::basic_logger as an ivar to the http server handler. I could print a few statistics every time the handler functor is called. Possibly add a command line parameter to specify a logging sink (text file, stdout, etc).

    When is the log member function in the handler called? I grep'd around and it's only called in http::sync_connection::start() when setting the socket options fails. Is this something that needs to be added in the library code as well?

    Another thing to consider is that Boost 1.47 does not include Boost.Log in the release. I (wrongly) assumed it would be in. Let me know what you guys think.

  6. deanberris commented on Aug 12, 2011

    @deanberris
    Member

    Since Boost.Log is not yet in the official Boost release, I would think it should be alright if you just made an example that actually did something in the body of the log function. This could be as simple as counting the number of errors encountered in requests and showing that it actually reports the errors.

    If you look closely enough at the code there's not a lot of information being provided to the log function. I'm thinking in 1.0 we should at least have better statistical hooks and extension points to the server implementation.

    For the purpose of the example though having something simple should be a good first step. We can then look at the deficiencies of the current approach and formulate a plan to address the issues we uncover then.

    Does that work? Thanks again for taking this one on!

  7. added a commit that references this issue on Aug 17, 2011
  8. added this to the 1.0 milestone on Dec 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions