コード例 #1
0
        /// <summary>
        /// This is the document db persistence agent.
        /// </summary>
        /// <param name="account">This is the documentdb id</param>
        /// <param name="base64key">This is the base64 encoded access key</param>
        /// <param name="databaseId">The is the databaseId name. If the Db does not exist it will be created.</param>
        /// <param name="collectionName">The is the collection name. If the collection does it exist it will be created.</param>
        public DocumentDbLogger(
            string account, string base64key, string database, string databaseCollection = null, LoggingLevel[] logLevels = null)
        {
            mDocDb    = new CollectionHolder(account, base64key, database, databaseCollection ?? typeof(LogEvent).Name);
            mInstance = string.Format("Logger_{0}_{1}", Environment.MachineName, DateTime.UtcNow.ToString("yyyyMMddHHmm"));

            if (logLevels != null)
            {
                mLoggingPermitted = new HashSet <LoggingLevel>(logLevels.Distinct());
            }
        }
コード例 #2
0
 /// <summary>
 /// This is the document db persistence agent.
 /// </summary>
 /// <param name="account">This is the documentdb id</param>
 /// <param name="base64key">This is the base64 encoded access key</param>
 /// <param name="databaseId">The is the databaseId name. If the Db does not exist it will be created.</param>
 /// <param name="collectionName">The is the collection name. If the collection does it exist it will be created.</param>
 public DocumentDbEventSource(
     string account, string base64key, string database, string databaseCollection = null)
 {
     mDocDb    = new CollectionHolder(account, base64key, database, databaseCollection ?? typeof(EventSourceEntry).Name);
     mInstance = string.Format("EventSource_{0}_{1}_", Environment.MachineName, DateTime.UtcNow.ToString("MMddHHmm"));
 }