diff --git a/Sources/MyFirstBlazor/.dockerignore b/Sources/MyFirstBlazor/.dockerignore
new file mode 100644
index 0000000..3729ff0
--- /dev/null
+++ b/Sources/MyFirstBlazor/.dockerignore
@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md
\ No newline at end of file
diff --git a/Sources/MyFirstBlazor/Dockerfile b/Sources/MyFirstBlazor/Dockerfile
new file mode 100644
index 0000000..530e98d
--- /dev/null
+++ b/Sources/MyFirstBlazor/Dockerfile
@@ -0,0 +1,22 @@
+#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
+
+FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
+WORKDIR /app
+EXPOSE 80
+EXPOSE 443
+
+FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+WORKDIR /src
+COPY ["MyFirstBlazor.csproj", "."]
+RUN dotnet restore "./MyFirstBlazor.csproj"
+COPY . .
+WORKDIR "/src/."
+RUN dotnet build "MyFirstBlazor.csproj" -c Release -o /app/build
+
+FROM build AS publish
+RUN dotnet publish "MyFirstBlazor.csproj" -c Release -o /app/publish /p:UseAppHost=false
+
+FROM base AS final
+WORKDIR /app
+COPY --from=publish /app/publish .
+ENTRYPOINT ["dotnet", "MyFirstBlazor.dll"]
\ No newline at end of file
diff --git a/Sources/MyFirstBlazor/MyFirstBlazor.csproj b/Sources/MyFirstBlazor/MyFirstBlazor.csproj
index 5f6950d..4459bef 100644
--- a/Sources/MyFirstBlazor/MyFirstBlazor.csproj
+++ b/Sources/MyFirstBlazor/MyFirstBlazor.csproj
@@ -4,6 +4,9 @@
net6.0
enable
enable
+ 46409403-a387-4a3c-97c7-fd1229ffbb01
+ Linux
+ .
@@ -13,6 +16,7 @@
+
diff --git a/Sources/MyFirstBlazor/Pages/CreateLog.razor b/Sources/MyFirstBlazor/Pages/CreateLog.razor
new file mode 100644
index 0000000..89c8922
--- /dev/null
+++ b/Sources/MyFirstBlazor/Pages/CreateLog.razor
@@ -0,0 +1,5 @@
+@page "/logs"
+
+
CreateLog
+
+
\ No newline at end of file
diff --git a/Sources/MyFirstBlazor/Pages/CreateLog.razor.cs b/Sources/MyFirstBlazor/Pages/CreateLog.razor.cs
new file mode 100644
index 0000000..1387107
--- /dev/null
+++ b/Sources/MyFirstBlazor/Pages/CreateLog.razor.cs
@@ -0,0 +1,21 @@
+using Microsoft.AspNetCore.Components;
+using Microsoft.Extensions.Logging;
+
+namespace MyFirstBlazor.Pages
+{
+ public partial class CreateLog
+ {
+ [Inject]
+ public ILogger Logger { get; set; }
+
+ private void CreateLogs()
+ {
+ var logLevels = Enum.GetValues(typeof(LogLevel)).Cast();
+
+ foreach (var logLevel in logLevels.Where(l => l != LogLevel.None))
+ {
+ Logger.Log(logLevel, $"Log message for the level: {logLevel}");
+ }
+ }
+ }
+}
diff --git a/Sources/MyFirstBlazor/Properties/launchSettings.json b/Sources/MyFirstBlazor/Properties/launchSettings.json
index 3f6b652..10df724 100644
--- a/Sources/MyFirstBlazor/Properties/launchSettings.json
+++ b/Sources/MyFirstBlazor/Properties/launchSettings.json
@@ -1,21 +1,13 @@
{
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:42081",
- "sslPort": 44363
- }
- },
"profiles": {
"MyFirstBlazor": {
"commandName": "Project",
- "dotnetRunMessages": true,
"launchBrowser": true,
- "applicationUrl": "https://localhost:7190;http://localhost:5190",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
- }
+ },
+ "dotnetRunMessages": true,
+ "applicationUrl": "https://localhost:7190;http://localhost:5190"
},
"IIS Express": {
"commandName": "IISExpress",
@@ -23,6 +15,21 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
+ },
+ "Docker": {
+ "commandName": "Docker",
+ "launchBrowser": true,
+ "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
+ "publishAllPorts": true,
+ "useSSL": true
+ }
+ },
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:42081",
+ "sslPort": 44363
}
}
-}
+}
\ No newline at end of file
diff --git a/Sources/MyFirstBlazor/wwwroot/.drone.yml b/Sources/MyFirstBlazor/wwwroot/.drone.yml
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/Sources/MyFirstBlazor/wwwroot/.drone.yml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/Sources/MyFirstBlazor/wwwroot/appsettings.json b/Sources/MyFirstBlazor/wwwroot/appsettings.json
index ef6372d..a3acd2a 100644
--- a/Sources/MyFirstBlazor/wwwroot/appsettings.json
+++ b/Sources/MyFirstBlazor/wwwroot/appsettings.json
@@ -1,9 +1,19 @@
{
"Logging": {
- "LogLevel": {
- "Default": "Trace",
- "Microsoft": "Warning",
- "Microsoft.Hosting.Lifetime": "Information"
+ "LogLevel": { // All providers, LogLevel applies to all the enabled providers.
+ "Default": "Error", // Default logging, Error and higher.
+ "Microsoft": "Warning" // All Microsoft* categories, Warning and higher.
+ },
+ "Debug": { // Debug provider.
+ "LogLevel": {
+ "Default": "Information", // Overrides preceding LogLevel:Default setting.
+ "Microsoft.Hosting": "Trace" // Debug:Microsoft.Hosting category.
+ }
+ },
+ "EventSource": { // EventSource provider
+ "LogLevel": {
+ "Default": "Warning" // All categories of EventSource provider.
+ }
}
}
}
\ No newline at end of file