Skip to content

Update DAB Validate for Filters #2586

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

Closed
RubenCerna2079 opened this issue Feb 14, 2025 · 0 comments · Fixed by #2620
Closed

Update DAB Validate for Filters #2586

RubenCerna2079 opened this issue Feb 14, 2025 · 0 comments · Fixed by #2620
Assignees
Labels
improvement Let's make this better validation

Comments

@RubenCerna2079
Copy link
Contributor

No description provided.

@aaronburtle aaronburtle added improvement Let's make this better validation labels Feb 19, 2025
@RubenCerna2079 RubenCerna2079 linked a pull request Mar 14, 2025 that will close this issue
2 tasks
RubenCerna2079 added a commit that referenced this issue Apr 1, 2025
## Why make this change?

This change solves tasks, #2584, #2585, #2586, #2587, #2588, #2569. 
All of them are part of the bigger task of #2563 which adds filters for
logging.

## What is this change?
This change allows the users to add more specific logging filters to
their config file, this means that log-levels meant for a specific class
will take priority over the default log-level.
In the following example, even if the default is in `debug`, the logging
for `IQueryExecutor` will be in `information`.
```
"Azure.DataApiBuilder.Core.Resolvers.IQueryExecutor": "information",
"default": "debug"
```
Specific Changes:
- Changed the schema file so that it allows for different keywords that
represent the classes, allowing each of them to have a different
log-level. It also allows the user to add a general log-level through
the use of the keyword `default` 
- Updated DAB Validate so that it checks if the keywords used in the
config file are valid classes that we use to give logging information to
the users.
- Change logic that deserializes the new properties in the config file
and stores them inside of the `TelemetryOptions` class and it uses the
saved log-levels to dictate if a specific logger uses a different
log-level from the default. This change gets rid of the `loggerFactory`
and changes it to a dictionary.

## How was this tested?
- [ ] Integration Tests
- [X] Unit Tests

Following tests were added:
- Test that filters are deserialized correctly and their values are what
we expect them to be.
- Test that invalid filters throw an error.
- Test that between two filters, the one that is more specific takes
priority.

## Sample Request(s)

![image](https://github.com/user-attachments/assets/4dbf7a98-7aba-4781-97f3-4b32fa8d77e0)

---------

Co-authored-by: Ruben Cerna <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Let's make this better validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants