Skip to content

Commit e617edf

Browse files
fix: Logs are not handled based on flag
1 parent 719f47a commit e617edf

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

docs/DeploymentGuide.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ You can run this solution in VS Code Dev Containers, which will open the project
7878
If you're not using one of the above options for opening the project, then you'll need to:
7979

8080
1. Make sure the following tools are installed:
81-
81+
- [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) <small>(v7.0+)</small> - available for Windows, macOS, and Linux.
8282
- [Azure Developer CLI (azd)](https://aka.ms/install-azd)
8383
- [Python 3.9+](https://www.python.org/downloads/)
8484
- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
@@ -173,8 +173,12 @@ If you need to rebuild the source code and push the updated container to the dep
173173
```powershell
174174
$env:USE_LOCAL_BUILD = $true
175175
```
176+
2. Run the `az login` command
177+
```bash
178+
az login
179+
```
176180
177-
2. Run the `azd up` command again to rebuild and push the updated container:
181+
3. Run the `azd up` command again to rebuild and push the updated container:
178182
```bash
179183
azd up
180184
```

infra/main.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ module updateContainerApp './container_app/deploy_container_app_api_web.bicep' =
229229
params: {
230230
solutionName: solutionPrefix
231231
location: secondaryLocation
232-
azureContainerRegistry: useLocalBuild == 'true' ? containerRegistry.outputs.acrEndpoint : containerImageEndPoint
232+
azureContainerRegistry: toLower(useLocalBuild) == 'true' ? containerRegistry.outputs.acrEndpoint : containerImageEndPoint
233233
appConfigEndPoint: appconfig.outputs.appConfigEndpoint
234234
containerAppEnvId: containerAppEnv.outputs.containerEnvId
235235
containerRegistryReaderId: containerAppEnv.outputs.containerRegistryReaderId
@@ -241,7 +241,7 @@ module updateContainerApp './container_app/deploy_container_app_api_web.bicep' =
241241
maxReplicaContainerApi: maxReplicaContainerApi
242242
minReplicaContainerWeb: minReplicaContainerWeb
243243
maxReplicaContainerWeb: maxReplicaContainerWeb
244-
useLocalBuild: useLocalBuild
244+
useLocalBuild: toLower(useLocalBuild)
245245
}
246246
dependsOn: [roleAssignments]
247247
}

src/ContentProcessorAPI/app/appsettings.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class AppConfiguration(ModelBaseSettings):
2929
app_cps_processes: str
3030
app_message_queue_extract: str
3131
app_cps_max_filesize_mb: int
32+
app_logging_enable: bool
33+
app_logging_level: str
3234

33-
34-
logging.basicConfig(level=logging.DEBUG)
3535
# Read .env file
3636
# Get Current Path + .env file
3737
env_file_path = os.path.join(os.path.dirname(__file__), ".env")
@@ -44,6 +44,14 @@ class AppConfiguration(ModelBaseSettings):
4444

4545
app_config = AppConfiguration()
4646

47+
if app_config.app_logging_enable:
48+
# Read Configuration for Logging Level as a Text then retrive the logging level
49+
logging_level = getattr(
50+
logging, app_config.app_logging_level
51+
)
52+
logging.basicConfig(level=logging_level)
53+
else:
54+
logging.disable(logging.CRITICAL)
4755

4856
# Dependency Function
4957
def get_app_config() -> AppConfiguration:

0 commit comments

Comments
 (0)