Linked Questions

Popular Questions

How to use with some collection name in log4net for mongodb

Asked by At

I use with log4net for writing logs to mongodb I defined the app.config file:

    <appender name="MongoDBAppender" type="ait_drm_logger.MongoAppender, ait-drm-logger">
        <name value="timestamp" />
        <layout type="log4net.Layout.RawTimeStampLayout" />
        <name value="level" />
        <layout type="log4net.Layout.PatternLayout" value="%level" />
        <name value="thread" />
        <layout type="log4net.Layout.PatternLayout" value="%thread" />
        <name value="logger" />
        <layout type="log4net.Layout.PatternLayout" value="%logger" />
        <name value="message" />
        <layout type="log4net.Layout.PatternLayout" value="%message" />
        <name value="Exception" />
        <layout type="log4net.Layout.RawPropertyLayout">
          <key value="Exception" />
      <level value="ALL" />
      <appender-ref ref="MongoDBAppender" />

in real time I want to change the name of the collection, because I want to write the logs to other collection documents in MongoDB (from action_logs to api_logs) how can I change it, or define it in the config?

Related Questions