-
Notifications
You must be signed in to change notification settings - Fork 324
Add Serilog example #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TGrannen
wants to merge
3
commits into
dotnet:main
Choose a base branch
from
TGrannen:tgrannen/aspire-serilog-example
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Serilog example #107
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
samples/AspireWithSerilog/AspireWithSerilog.ApiService/AspireWithSerilog.ApiService.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\AspireWithSerilog.ServiceDefaults\AspireWithSerilog.ServiceDefaults.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
43 changes: 43 additions & 0 deletions
43
samples/AspireWithSerilog/AspireWithSerilog.ApiService/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| using Serilog; | ||
|
|
||
| var builder = WebApplication.CreateBuilder(args); | ||
|
|
||
| // Add service defaults & Aspire components. | ||
| builder.AddServiceDefaults(); | ||
|
|
||
| // Add services to the container. | ||
| builder.Services.AddProblemDetails(); | ||
|
|
||
| var app = builder.Build(); | ||
|
|
||
| // Configure the HTTP request pipeline. | ||
| app.UseExceptionHandler(); | ||
|
|
||
| app.UseSerilogRequestLogging(); | ||
|
|
||
| var summaries = new[] | ||
| { | ||
| "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | ||
| }; | ||
|
|
||
| app.MapGet("/weatherforecast", () => | ||
| { | ||
| var forecast = Enumerable.Range(1, 5).Select(index => | ||
| new WeatherForecast | ||
| ( | ||
| DateOnly.FromDateTime(DateTime.Now.AddDays(index)), | ||
| Random.Shared.Next(-20, 55), | ||
| summaries[Random.Shared.Next(summaries.Length)] | ||
| )) | ||
| .ToArray(); | ||
| return forecast; | ||
| }); | ||
|
|
||
| app.MapDefaultEndpoints(); | ||
|
|
||
| app.Run(); | ||
|
|
||
| record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) | ||
| { | ||
| public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
| } |
15 changes: 15 additions & 0 deletions
15
samples/AspireWithSerilog/AspireWithSerilog.ApiService/Properties/launchSettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "$schema": "http://json.schemastore.org/launchsettings.json", | ||
| "profiles": { | ||
| "http": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": true, | ||
| "launchUrl": "weatherforecast", | ||
| "applicationUrl": "http://localhost:5387", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development" | ||
| } | ||
| } | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
samples/AspireWithSerilog/AspireWithSerilog.ApiService/appsettings.Development.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "Logging": { | ||
| "LogLevel": { | ||
| "Default": "Information", | ||
| "Microsoft.AspNetCore": "Warning" | ||
| } | ||
| } | ||
| } |
20 changes: 20 additions & 0 deletions
20
samples/AspireWithSerilog/AspireWithSerilog.ApiService/appsettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "Logging": { | ||
| "LogLevel": { | ||
| "Default": "Information", | ||
| "Microsoft.AspNetCore": "Warning" | ||
| } | ||
| }, | ||
| "Serilog": { | ||
| "MinimumLevel": { | ||
| "Default": "Information", | ||
| "Override": { | ||
| "Microsoft.AspNetCore": "Warning" | ||
| } | ||
| }, | ||
| "Enrich": [ | ||
| "FromLogContext" | ||
| ] | ||
| }, | ||
| "AllowedHosts": "*" | ||
| } |
20 changes: 20 additions & 0 deletions
20
samples/AspireWithSerilog/AspireWithSerilog.AppHost/AspireWithSerilog.AppHost.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <IsAspireHost>true</IsAspireHost> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\AspireWithSerilog.ApiService\AspireWithSerilog.ApiService.csproj" /> | ||
| <ProjectReference Include="..\AspireWithSerilog.Web\AspireWithSerilog.Web.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Aspire.Hosting" Version="8.0.0-preview.2.23619.3" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
8 changes: 8 additions & 0 deletions
8
samples/AspireWithSerilog/AspireWithSerilog.AppHost/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| var builder = DistributedApplication.CreateBuilder(args); | ||
|
|
||
| var apiService = builder.AddProject<Projects.AspireWithSerilog_ApiService>("apiservice"); | ||
|
|
||
| builder.AddProject<Projects.AspireWithSerilog_Web>("webfrontend") | ||
| .WithReference(apiService); | ||
|
|
||
| builder.Build().Run(); |
16 changes: 16 additions & 0 deletions
16
samples/AspireWithSerilog/AspireWithSerilog.AppHost/Properties/launchSettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "$schema": "http://json.schemastore.org/launchsettings.json", | ||
| "profiles": { | ||
| "http": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": true, | ||
| "applicationUrl": "http://localhost:15118", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development", | ||
| "DOTNET_ENVIRONMENT": "Development", | ||
| "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16257" | ||
| } | ||
| } | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
samples/AspireWithSerilog/AspireWithSerilog.AppHost/appsettings.Development.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "Logging": { | ||
| "LogLevel": { | ||
| "Default": "Information", | ||
| "Microsoft.AspNetCore": "Warning" | ||
| } | ||
| } | ||
| } |
21 changes: 21 additions & 0 deletions
21
samples/AspireWithSerilog/AspireWithSerilog.AppHost/appsettings.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "Logging": { | ||
| "LogLevel": { | ||
| "Default": "Information", | ||
| "Microsoft.AspNetCore": "Warning", | ||
| "Aspire.Hosting.Dcp": "Warning" | ||
| } | ||
| }, | ||
| "Serilog": { | ||
| "MinimumLevel": { | ||
| "Default": "Information", | ||
| "Override": { | ||
| "Microsoft.AspNetCore": "Warning", | ||
| "Aspire.Hosting.Dcp": "Warning" | ||
| } | ||
| }, | ||
| "Enrich": [ | ||
| "FromLogContext" | ||
| ] | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
...ireWithSerilog/AspireWithSerilog.ServiceDefaults/AspireWithSerilog.ServiceDefaults.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <IsAspireSharedProject>true</IsAspireSharedProject> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
|
|
||
| <PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" /> | ||
| <PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0-preview.2.23619.3" /> | ||
| <PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0-alpha.1" /> | ||
| <PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0-alpha.1" /> | ||
| <PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.6.0-beta.2" /> | ||
| <PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.6.0-beta.2" /> | ||
| <PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.6.0-beta.2" /> | ||
| <PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" /> | ||
| <PackageReference Include="Serilog.AspNetCore" Version="8.0.1"/> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
121 changes: 121 additions & 0 deletions
121
samples/AspireWithSerilog/AspireWithSerilog.ServiceDefaults/Extensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| using Microsoft.AspNetCore.Builder; | ||
| using Microsoft.AspNetCore.Diagnostics.HealthChecks; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using Microsoft.Extensions.Diagnostics.HealthChecks; | ||
| using Microsoft.Extensions.Logging; | ||
| using OpenTelemetry.Logs; | ||
| using OpenTelemetry.Metrics; | ||
| using OpenTelemetry.Trace; | ||
|
|
||
| namespace Microsoft.Extensions.Hosting; | ||
|
|
||
| public static class Extensions | ||
| { | ||
| public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder) | ||
| { | ||
| builder.ConfigureSerilog(); | ||
|
|
||
| builder.ConfigureOpenTelemetry(); | ||
|
|
||
| builder.AddDefaultHealthChecks(); | ||
|
|
||
| builder.Services.AddServiceDiscovery(); | ||
|
|
||
| builder.Services.ConfigureHttpClientDefaults(http => | ||
| { | ||
| // Turn on resilience by default | ||
| http.AddStandardResilienceHandler(); | ||
|
|
||
| // Turn on service discovery by default | ||
| http.UseServiceDiscovery(); | ||
| }); | ||
|
|
||
| return builder; | ||
| } | ||
|
|
||
| public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicationBuilder builder) | ||
| { | ||
| builder.Logging.AddOpenTelemetry(logging => | ||
| { | ||
| logging.IncludeFormattedMessage = true; | ||
| logging.IncludeScopes = true; | ||
| }); | ||
|
|
||
| builder.Services.AddOpenTelemetry() | ||
| .WithMetrics(metrics => | ||
| { | ||
| metrics.AddRuntimeInstrumentation() | ||
| .AddBuiltInMeters(); | ||
| }) | ||
| .WithTracing(tracing => | ||
| { | ||
| if (builder.Environment.IsDevelopment()) | ||
| { | ||
| // We want to view all traces in development | ||
| tracing.SetSampler(new AlwaysOnSampler()); | ||
| } | ||
|
|
||
| tracing.AddAspNetCoreInstrumentation() | ||
| .AddGrpcClientInstrumentation() | ||
| .AddHttpClientInstrumentation(); | ||
| }); | ||
|
|
||
| builder.AddOpenTelemetryExporters(); | ||
|
|
||
| return builder; | ||
| } | ||
|
|
||
| private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostApplicationBuilder builder) | ||
| { | ||
| var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]); | ||
|
|
||
| if (useOtlpExporter) | ||
| { | ||
| builder.Services.Configure<OpenTelemetryLoggerOptions>(logging => logging.AddOtlpExporter()); | ||
| builder.Services.ConfigureOpenTelemetryMeterProvider(metrics => metrics.AddOtlpExporter()); | ||
| builder.Services.ConfigureOpenTelemetryTracerProvider(tracing => tracing.AddOtlpExporter()); | ||
| } | ||
|
|
||
| // Uncomment the following lines to enable the Prometheus exporter (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package) | ||
| // builder.Services.AddOpenTelemetry() | ||
| // .WithMetrics(metrics => metrics.AddPrometheusExporter()); | ||
|
|
||
| // Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.Exporter package) | ||
| // builder.Services.AddOpenTelemetry() | ||
| // .UseAzureMonitor(); | ||
|
|
||
| return builder; | ||
| } | ||
|
|
||
| public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicationBuilder builder) | ||
| { | ||
| builder.Services.AddHealthChecks() | ||
| // Add a default liveness check to ensure app is responsive | ||
| .AddCheck("self", () => HealthCheckResult.Healthy(), ["live"]); | ||
|
|
||
| return builder; | ||
| } | ||
|
|
||
| public static WebApplication MapDefaultEndpoints(this WebApplication app) | ||
| { | ||
| // Uncomment the following line to enable the Prometheus endpoint (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package) | ||
| // app.MapPrometheusScrapingEndpoint(); | ||
|
|
||
| // All health checks must pass for app to be considered ready to accept traffic after starting | ||
| app.MapHealthChecks("/health"); | ||
|
|
||
| // Only health checks tagged with the "live" tag must pass for app to be considered alive | ||
| app.MapHealthChecks("/alive", new HealthCheckOptions | ||
| { | ||
| Predicate = r => r.Tags.Contains("live") | ||
| }); | ||
|
|
||
| return app; | ||
| } | ||
|
|
||
| private static MeterProviderBuilder AddBuiltInMeters(this MeterProviderBuilder meterProviderBuilder) => | ||
| meterProviderBuilder.AddMeter( | ||
| "Microsoft.AspNetCore.Hosting", | ||
| "Microsoft.AspNetCore.Server.Kestrel", | ||
| "System.Net.Http"); | ||
| } |
48 changes: 48 additions & 0 deletions
48
samples/AspireWithSerilog/AspireWithSerilog.ServiceDefaults/SerilogExtensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| using Microsoft.Extensions.Logging; | ||
| using Serilog; | ||
| using Serilog.Events; | ||
|
|
||
| namespace Microsoft.Extensions.Hosting; | ||
|
|
||
| public static class SerilogExtensions | ||
| { | ||
| /// <summary> | ||
| /// Configure Serilog to write to the console and OpenTelemetry for Aspire structured logs. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// ⚠ This method MUST be called before the <see cref="OpenTelemetryLoggingExtensions.AddOpenTelemetry(ILoggingBuilder)"/> method to still send structured logs via OpenTelemetry. ⚠ | ||
| /// </remarks> | ||
| internal static IHostApplicationBuilder ConfigureSerilog(this IHostApplicationBuilder builder) | ||
| { | ||
| // Removes the built-in logging providers | ||
| builder.Logging.ClearProviders(); | ||
|
|
||
| // Including the writeToProviders=true parameter allows the OpenTelemetry logger to still be written to | ||
| builder.Services.AddSerilog((_, loggerConfiguration) => | ||
| { | ||
| // Configure Serilog as desired here for every project (or use IConfiguration for configuration variations between projects) | ||
| loggerConfiguration | ||
| .ReadFrom.Configuration(builder.Configuration) | ||
| .Enrich.FromLogContext() | ||
| .WriteTo.Console(); | ||
| }, writeToProviders: true); | ||
|
|
||
| return builder; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Sets up a initial logger to catch and report exceptions thrown during set-up of the ASP.NET Core host. | ||
| /// This follows the Two-stage initialization process documented <a href="https://github.com/serilog/serilog-aspnetcore?tab=readme-ov-file#two-stage-initialization">here</a>. | ||
| /// </summary> | ||
| /// <param name="logger">Only used for the extension method base type</param> | ||
| public static Serilog.ILogger ConfigureSerilogBootstrapLogger(this Serilog.ILogger logger) | ||
| { | ||
| Log.Logger = new LoggerConfiguration() | ||
| .MinimumLevel.Override("Microsoft", LogEventLevel.Information) | ||
| .Enrich.FromLogContext() | ||
| .WriteTo.Console() | ||
| .CreateBootstrapLogger(); | ||
|
|
||
| return logger; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not disable the otlp logger in service defaults with a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The oltp logger still needs to be enabled and configured to get Structured Logs to work in the dashboard (instead of just console logs). I attempted to use the Serilog OpenTelemetry Sink instead of the oltp logger, but I ran into the issue mentioned earlier today that ended up creating multiple records in the dashboard. It would be much better to switch to Serilog entirely, but I didn't know exactly what OpenTelemetry/Sink configuration might need to be added to prevent the issue in the dashboard. I've only lightly dabbled with OpenTelemetry so far and didn't have time to get too far into it on a Saturday night.
If there's a simple fix for the issue or somewhere that I could go to to get pointed down the right path, I'd be happy to try a few more things and rework this to switch everything over to just use Serilog.
I also mentioned this same thing in my comment on the issue related to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this PR trying to showing using serilog alongside the otel logger provider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, but more as a work around than what the final desired approach would be.