예제 #1
0
        /// <summary>
        /// Construct a sink that saves logs to the specified storage account. Properties are being send as data and the level is used as tag.
        /// </summary>
        ///  <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
        /// <param name="logKey">The log key as found on the loggr website.</param>
        /// <param name="apiKey">The api key as found on the loggr website.</param>
        /// <param name="useSecure">Use a SSL connection. By default this is false.</param>
        /// <param name="userNameProperty">Specifies the property name to read the username from. By default it is UserName.</param>
        public LoggrSink(IFormatProvider formatProvider, string logKey, string apiKey, bool useSecure = false, string userNameProperty = "UserName")
        {
            _formatProvider = formatProvider;
            _userNameProperty = userNameProperty;

            _client = new LogClient(logKey, apiKey, useSecure);
        }
예제 #2
0
        /// <summary>
        /// Tracks a user's activity
        /// </summary>
        /// <param name="username">Username of user to track</param>
        /// <param name="email">Email address of user to track</param>
        /// <param name="page">Page being viewed by user</param>
        /// <param name="async">A bool that specifies how user tracking should be sent to Loggr. Typically an application will post asynchronously for best performance, but sometimes it needs to be posted synchronously if the application needs to block until the post has completed</param>
        public static void TrackUser(string username, string email, string page, bool async)
        {
            LogClient client = new LogClient();

            if (_logKey != null)
            {
                client.LogKey = _logKey;
                client.ApiKey = _apiKey;
            }

            client.TrackUser(username, email, page, async);
        }
예제 #3
0
 public void LogClient_Settings()
 {
     Loggr.Utility.Configuration.UseSettings(new Loggr.Utility.Settings
     {
         ApiKey  = "APIKEY",
         LogKey  = "LOGKEY",
         Server  = "SERVER",
         Version = "VERSION",
         Secure  = false,
     });
     Loggr.LogClient client = new Loggr.LogClient();
     Assert.IsTrue(client.ApiKey == "APIKEY");
     Assert.IsTrue(client.LogKey == "LOGKEY");
     Assert.IsTrue(client.Server == "SERVER");
     Assert.IsTrue(client.Version == "VERSION");
     Assert.IsTrue(client.Secure == false);
 }
예제 #4
0
 public void LogClient_PostNoText()
 {
     Loggr.LogClient client = new Loggr.LogClient();
     client.Post(new Event());
 }
예제 #5
0
 /// <summary>
 /// Tracks a user's activity
 /// </summary>
 /// <param name="username">Username of user to track</param>
 /// <param name="email">Email address of user to track</param>
 /// <param name="page">Page being viewed by user</param>
 /// <param name="async">A bool that specifies how user tracking should be sent to Loggr. Typically an application will post asynchronously for best performance, but sometimes it needs to be posted synchronously if the application needs to block until the post has completed</param>
 public static void TrackUser(string username, string email, string page, bool async)
 {
     LogClient client = new LogClient();
     client.TrackUser(username, email, page, async);
 }
예제 #6
0
 public void LogClient_PostNoText()
 {
     Loggr.LogClient client = new Loggr.LogClient();
     client.Post(new Event());
 }