s-fleck / lgrextra Goto Github PK
View Code? Open in Web Editor NEWExtra Appenders for the lgr Package
Home Page: https://s-fleck.github.io/lgrExtra/
License: Other
Extra Appenders for the lgr Package
Home Page: https://s-fleck.github.io/lgrExtra/
License: Other
I have tried to start logging to database:
lg <- get_logger("db_logger")
lg$
set_propagate(FALSE)$
add_appender(
name = "db",
lgrExtra::AppenderDbi$new(
conn = dbConnect(RPostgres::Postgres(),
dbname = "defaultdb",
host = "xxxxdb.ondigitalocean.com",
port = 25060L,
user = "doadmin",
password = "xxx"
),
table = "log",
buffer_size = 2L
)
)
but I get an error:
Error in sprintf(message, ...) : too few arguments
Hi,
I'm just parking this feature request here in case others might be interested as well. Our shop is moving from Postgres to using LogDNA.com (https://logdna.com/) for distributed application logging. There's an existing Python client for LogDNA (https://github.com/logdna/python), but nothing equivalent on CRAN yet.
Would seem a good fit for either lgr
or @daroczig's logger
?
AppenderDbi works great for shiny apps. The same is applicable for the connection pool produced by {pool}
However, pool object can't be used as a connection for the appender
con <- pool::dbPool(RPostgres::Postgres(),
dbname = dbname,
host = host,
port = port,
user = user,
password = password)
lg <- get_logger("db_logger")
lg$
set_propagate(FALSE)$
add_appender(
name = "db",
lgrExtra::AppenderDbi$new(
conn = con,
table = "audit_log",
buffer_size = 5L
)
)
#Error in switch(cls, PostgreSQLConnection = LayoutPostgres$new(...), PqConnection = LayoutPostgres$new(...), :
#EXPR must be a length 1 vector
It would be nice to have this functionality
Log appender that sends logs to Azure Log Analytics.
Azure Log analytics API reference https://docs.microsoft.com/en-us/rest/api/loganalytics/create-request
Azure Log Analytics would allow sending application logs to a centralized location, where they can be analysed using Kusto Query Language (KQL) and set to trigger automated alerts based on these queries.
Edit: Added use case.
Hello!
It would be nice if the package included AppenderTelegram.
For example in logger
package - https://daroczig.github.io/logger/reference/appender_telegram.html
For this feature you can user package telegram.bot - https://cran.r-project.org/web/packages/telegram.bot/index.html
Allow functions for ElasticSearch index name, and add the possibility to supply mappings for automatically creating elastic search indices
A similar idea to #2, however using AWS CloudWatch logs. To achieve this I use paws
to make the connection with AWS.
I have got an initial version of this on my folk: https://github.com/DyfanJones/lgrExtra/tree/aws_cloudwatch
remotes::install_github("dyfanjones/lgrExtra")
library(lgrExtra)
app <- AppenderAWSCloudWatchLog$new(log_group_name = "lgrExtra")
lg <- lgr::get_logger("lgrExtra")$add_appender(app)$set_propagate(FALSE)
lg$info("Foo")
lg$warn("Bar")
lg$error("cho")
> app$log_group_name
[1] "lgrExtra"
> app$log_stream_name
[1] "lgrExtra/2023-09-22/bm6qnrzt"
> app$data
[[1]]
[1] "INFO : Foo"
[[2]]
[1] "WARN : Bar"
[[3]]
[1] "ERROR: cho"
Let me know if your interested in adding this feature. I haven't added any unit tests as of yet, but happy to work on this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.