<commit_before>using System;
using System.IO;
using System.IO.Compression;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Exceptionless.Core.Utility;
using Foundatio.Jobs;
using NLog.Fluent;

namespace Exceptionless.Core.Jobs {
    public class DownloadGeoIPDatabaseJob : JobBase {
        protected override async Task<JobResult> RunInternalAsync(CancellationToken token) {
            var path = PathHelper.ExpandPath(Settings.Current.GeoIPDatabasePath);
            if (String.IsNullOrEmpty(path)) {
                Log.Error().Message("No GeoIPDatabasePath was specified.").Write();
                return JobResult.FailedWithMessage("No GeoIPDatabasePath was specified.");
            }

            try {
                if (File.Exists(path)) {
                    Log.Info().Message("Deleting existing GeoIP database.").Write();
                    File.Delete(path);
                }

                Log.Info().Message("Downloading GeoIP database.").Write();
                var client = new HttpClient();
                var file = await client.GetAsync("http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz", token);
                if (!file.IsSuccessStatusCode)
                    return JobResult.FailedWithMessage("Unable to download GeoIP database.");

                Log.Info().Message("Extracting GeoIP database.").Write();
                using (FileStream decompressedFileStream = new FileStream(path, FileMode.CreateNew)) {
                    using (GZipStream decompressionStream = new GZipStream(await file.Content.ReadAsStreamAsync(), CompressionMode.Decompress)) {
                        decompressionStream.CopyTo(decompressedFileStream);
                    }
                }
            } catch (Exception ex) {
                Log.Error().Exception(ex).Message("An error occurred while downloading the GeoIP database.").Write();
                return JobResult.FromException(ex);
            }

            Log.Info().Message("Finished downloading GeoIP database.").Write();
            return JobResult.Success;
        }
    }
}<commit_msg>Added additional logging to the geo job<commit_after>using System;
using System.IO;
using System.IO.Compression;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Exceptionless.Core.Utility;
using Foundatio.Jobs;
using NLog.Fluent;

namespace Exceptionless.Core.Jobs {
    public class DownloadGeoIPDatabaseJob : JobBase {
        protected override async Task<JobResult> RunInternalAsync(CancellationToken token) {
            var path = PathHelper.ExpandPath(Settings.Current.GeoIPDatabasePath);
            if (String.IsNullOrEmpty(path)) {
                Log.Error().Message("No GeoIPDatabasePath was specified.").Write();
                return JobResult.FailedWithMessage("No GeoIPDatabasePath was specified.");
            }

            try {
                if (File.Exists(path)) {
                    Log.Info().Message("Deleting existing GeoIP database \\{0}\".", path).Write();
                    File.Delete(path);
                }

                Log.Info().Message("Downloading GeoIP database.").Write();
                var client = new HttpClient();
                var file = await client.GetAsync("http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz", token);
                if (!file.IsSuccessStatusCode)
                    return JobResult.FailedWithMessage("Unable to download GeoIP database.");

                Log.Info().Message("Extracting GeoIP database to \\{0}\".", path).Write();
                using (FileStream decompressedFileStream = new FileStream(path, FileMode.CreateNew)) {
                    using (GZipStream decompressionStream = new GZipStream(await file.Content.ReadAsStreamAsync(), CompressionMode.Decompress)) {
                        decompressionStream.CopyTo(decompressedFileStream);
                    }
                }
            } catch (Exception ex) {
                Log.Error().Exception(ex).Message("An error occurred while downloading the GeoIP database \\{0}\".", path).Write();
                return JobResult.FromException(ex);
            }

            Log.Info().Message("Finished downloading GeoIP database.").Write();
            return JobResult.Success;
        }
    }
}
{'fraction_non_alphanumeric': 0.10752935758692149, 'fraction_numerical': 0.0011512779184895234, 'mean_word_length': 2.2490650710546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7048944', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1051, 'n_words': 229}