Deleting Large amount of log entries

Hace 1 semana
Hi All

I need some advice please ! Nop 4.40.4

Our site has had the log blow out - it looks like a plugin is registering hundreds if not thousands of log entries per day so currently the log has over 3m entries.. and understandably i think that may be slowing the system down a bit.

No matter what I do I cannot clear the log - the clear log times out, the scheduled task times out and the only option is by deleting 1000 entries at a time, which i really dont fancy (i tried 10000 but the webpage froze)

I dont know SQL or even how to remotely access it.. so i'm kinda stuck short of sitting here for many hours selecting and deleting (i really wish nop allowed you to tick the all box and then choose all pages)

Any hints, advise or otherwise useful information to help?

Thanks in advance

Steve
Hace 1 semana
You will need to use SQL.  Is your site hosted?  They may have a control panel with a DB query page.  Otherwise you can install SSMS or a lightweight alternative like DBeaver.  You can get your connection information from your site's \AppData\appsettings.json file  ConnectionString.  

You could then use SQL commands:
Completely truncate the table (to remove all records) which is very fast:
  TRUNCATE TABLE [Log]

Or, selectively , e.g. by date
  DELETE [Log] WHERE CreatedOnUtc < '2024-03-01'

Hace 1 semana
Thanks for that info.

Connection info is simply 127.0.0.0 i assume its looking local as its hosted on the same server. Server is a remote hosted server and i only have access to it via plesk

I seem to be coming unstuck as i dont know the password for the DB it was set up by a company a few years back - if i change the password i assume that will screw up the NOP connection too?

Steve
Hace 1 semana
Hi Steve,
You need to connect with SQL.
Hace 1 semana
The Plesk console should have a SQL "app".  In the Plesk control panel. Look for options related to databases or SQL.  Ask your host tech support.

As mentioned above, you can get your connection information from your site's \AppData\appsettings.json file  ConnectionString.   Use the plesk console's File Manager to edit/view the file.  Don't change the content.  just get the info you need, and 'cancel'.  You will see something like this

"ConnectionString": "Data Source=localhost;Initial Catalog=nopCommerce460_sample;User ID=your_username;Password=your_password;Persist Security Info=True;Trust Server Certificate=True"

"Data Source" has the connect info. "Initial Catalog" is the database. User ID & Password are obvious ;)


(Ask your host tech support to help you :)
Hace 1 semana
New York wrote:
The Plesk console should have a SQL "app".  In the Plesk control panel. Look for options related to databases or SQL.  Ask your host tech support.

As mentioned above, you can get your connection information from your site's \AppData\appsettings.json file  ConnectionString.   Use the plesk console's File Manager to edit/view the file.  Don't change the content.  just get the info you need, and 'cancel'.  You will see something like this

"ConnectionString": "Data Source=localhost;Initial Catalog=nopCommerce460_sample;User ID=your_username;Password=your_password;Persist Security Info=True;Trust Server Certificate=True"

"Data Source" has the connect info. "Initial Catalog" is the database. User ID & Password are obvious ;)


(Ask your host tech support to help you :)


Thankyou for the info ... your time and info is greatly appreciated.

with the help of Jatin (Forefront infotech) who graciously spent some time with me over skype we managed to get onto the server (that was the tricky bit) and executed the log clearing etc.. the actual connection details were in datasettings.. for some reason.

So we cleared that and nearly a million guest users, unfortunately we cant shrink the DB file which is sitting at 24gb - so will contact the hosting guys to get it shrunk.. hopefully!

So half the issues gone now.. just some tidying up to do.
Thanks again for helping a clueless person :D

Steve