Skip to content
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

Neater cloudscribe logs: allow rendering newlines to <br /> in the log view? #41

Open
SimonAnnetts opened this issue Mar 8, 2023 · 1 comment
Assignees

Comments

@SimonAnnetts
Copy link
Contributor

It would be nice instead of seeing a log entry like this:

3/8/2023 4:06:39 PM Error ::1 cloudscribe.QueryTool.Web.QueryToolController /querytool

QueryTool: UserId:8af14603-ad31-4174-93d4-0fea2ba9ac86 Query: select * from cs_userX Command:query Npgsql.PostgresException (0x80004005): 42P01: relation "cs_userx" does not exist POSITION: 15 at Npgsql.Internal.NpgsqlConnector.g__ReadMessageLong|213_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at cloudscribe.QueryTool.Services.QueryTool.RawQueryAsync(DbConnection connection, String query) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Services\Services\QueryTool.cs:line 38 at cloudscribe.QueryTool.Services.QueryTool.ExecuteQueryAsync(String query) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Services\Services\ExecuteQueryAsync.cs:line 16 at cloudscribe.QueryTool.Web.QueryToolController.Index(QueryToolViewModel model) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Web\Controllers\QueryToolController.cs:line 140 Exception data: Severity: ERROR SqlState: 42P01 MessageText: relation "cs_userx" does not exist Position: 15 File: parse_relation.c Line: 1373 Routine: parserOpenTable

It could be more like this:

3/8/2023 4:06:39 PM Error ::1 cloudscribe.QueryTool.Web.QueryToolController /querytool

QueryTool:
UserId: 8af14603-ad31-4174-93d4-0fea2ba9ac86
Query: select * from cs_userX
Command: query 
Npgsql.PostgresException (0x80004005): 42P01: relation "cs_userx" does not exist POSITION: 15 at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|213_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at cloudscribe.QueryTool.Services.QueryTool.RawQueryAsync(DbConnection connection, String query) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Services\Services\QueryTool.cs:line 38 at cloudscribe.QueryTool.Services.QueryTool.ExecuteQueryAsync(String query) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Services\Services\ExecuteQueryAsync.cs:line 16 at cloudscribe.QueryTool.Web.QueryToolController.Index(QueryToolViewModel model) in C:\Development\cloudscribe\src\cloudscribe.QueryTool.Web\Controllers\QueryToolController.cs:line 140
Exception data: Severity: ERROR SqlState: 42P01 MessageText: relation "cs_userx" does not exist Position: 15 File: parse_relation.c Line: 1373 Routine: parserOpenTable

If we inserted (char)10 characters into a log message they could be converted in the view to <br /> tags.

@SimonAnnetts SimonAnnetts self-assigned this Mar 14, 2023
@SimonAnnetts SimonAnnetts transferred this issue from cloudscribe/cloudscribe Mar 14, 2023
@SimonAnnetts
Copy link
Contributor Author

cloudscribe.Logging.Web.6.0.1.nupkg

SimonAnnetts added a commit that referenced this issue Mar 15, 2023
#41 allow conversion of newlines to <br/> tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant