Ejemplo n.º 1
0
        /// <summary>
        /// Enrich log events with an AssemblyName property containing the current <see cref="AssemblyName.Name"/> of T.
        /// </summary>
        /// <param name="enrichmentConfiguration">Logger enrichment configuration.</param>
        /// <returns>Configuration object allowing method chaining.</returns>
        public static LoggerConfiguration WithAssemblyName <T>(this LoggerEnrichmentConfiguration enrichmentConfiguration)
        {
            var assembly = typeof(T).Assembly;

            return(enrichmentConfiguration.WithAssemblyName(assembly));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Enrich log events with an AssemblyName property containing the current <see cref="AssemblyName.Name"/>.
        /// </summary>
        /// <param name="enrichmentConfiguration">Logger enrichment configuration.</param>
        /// <returns>Configuration object allowing method chaining.</returns>
        public static LoggerConfiguration WithAssemblyName(this LoggerEnrichmentConfiguration enrichmentConfiguration)
        {
            var assembly = Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly();

            return(enrichmentConfiguration.WithAssemblyName(assembly));
        }