Replies: 1 comment 2 replies
-
|
Hi ! SQLPage write detailed access logs to stderr by default. But if you need to compute statistics, and you do not have very high traffic, then I'd advise writing the info to your database. CREATE TABLE page_visits (
page varchar(255),
variables JSONB,
headers JSONB,
ip_address INET,
visited_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);tracker.sqlinsert into page_visits
(page, variables, headers, ip_address)
values
(sqlpage.path(), sqlpage.variables('get'), sqlpage.headers(), sqlpage.client_ip());then include it from other pages using https://sql-page.com/functions.sql?function=run%5Fsql |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We would like to know who visited each page and at what time (statistics). Is there a way to access this SQLpage server info or write it to a DB ?
Beta Was this translation helpful? Give feedback.
All reactions