How to view the storage path of AnQiCMS log files to troubleshoot program errors?

Calendar 👁️ 77

As an experienced website operations expert, I am well aware that log files play a crucial role behind the stable operation of the system.When your AnQiCMS website encounters a program error, the log file is like a clue in the detective's hands, which can help us trace the cause and specific details of the problem.AnQiCMS is an enterprise-level content management system developed based on the Go language, with a simple and efficient logging mechanism. Understanding the storage path and viewing method of the log files is the first step in troubleshooting program errors and ensuring the healthy operation of the website.

Why are log files so important?

Imagine that your AnQiCMS website suddenly cannot be accessed, or some function appears abnormal.Faced with these sudden situations, we cannot rely solely on guesswork.At this time, the log file can provide the most direct and objective evidence.Error and exception information. By analyzing these logs, we can accurately locate the problematic code, incorrect configuration, resource bottlenecks, or other potential faults, and thus solve the problem specifically.

AnQiCMS as an application written in Go language, its log output is usually directed to standard output (stdout) and standard error (stderr).Where these outputs will ultimately converge depends on your specific deployment environment and method.Below, we will detail how to locate and view the log files based on common AnQiCMS deployment scenarios.

Log path under Linux server manual/script deployment environment

On the Linux server, if you are following the official documentation of AnQiCMS (such asinstall.mddescribed throughstart.shScript) for deployment, then the storage path of the log file will usually be very clear.

Officially providedstart.shIn the script, there is a key command line like this:nohup $BINPATH/$BINNAME >> $BINPATH/running.log 2>&1 &

The meaning of this command is to redirect all standard output and standard error of the AnQiCMS program($BINPATH/$BINNAMErepresenting the executable file path and name of AnQiCMS)(2>&1Redirected to the specified path.running.logthe file.nohupCommand ensures that the program continues to run in the background even if you close the terminal.

Therefore, in the directory of your AnQiCMS executable file (which isinstall.mdmentioned$BINPATHFor example/www/wwwroot/anqicms.com/), you will find a file namedrunning.logThe file. This file records all the outputs during the program startup and operation, including normal information and various errors.

exceptrunning.log,start.shThe script may also contain references tocheck.logFile writing. This file is usually used to record the self-check information of the script, such as whether the program is running, etc. Althoughrunning.logit is the main force for troubleshooting program errors, but understandingcheck.logThe existence also helps provide clues even if the program has not started.

How to view these log files:

After finding the log file, you can connect to the Linux server via SSH and use the following command to view the log content:

  • View in real time (recommended): tail -f /www/wwwroot/yourdomain/running.logThis will continue to displayrunning.logThe latest content of the file, which will be refreshed in real-time to the screen when new logs are generated, is very suitable for fault monitoring of running websites. Please/www/wwwroot/yourdomain/Replace with the actual AnQiCMS deployment path.
  • View all content: cat /www/wwwroot/yourdomain/running.logThis will print the entirerunning.logcontent of the file to the screen. If the log file is very large, it may scroll the screen.
  • Page through: less /www/wwwroot/yourdomain/running.logWhen the log file content is extensive,lessThe command can enable page through and supports search functionality, making it convenient for you to browse historical logs.

Log path under Docker container deployment environment

If you choose to use Docker (for example, through 1Panel or aaPanel deployment), AnQiCMS's log management method will be different, but still clear.

The design philosophy of Docker containers is to allow applications to output logs to their standard output (stdout) and standard error (stderr), while the Docker daemon captures these outputs.

How to view Docker container logs:

  • Use the Docker command line:First, you need to know the name or ID of the AnQiCMS container. You can find it bydocker psCommand to view the list of running containers. After finding the AnQiCMS container, the name is usually similar toanqicmsOr you can customize the name when deploying. Then, use the following command to view container logs:docker logs [container_name_or_id]For example:docker logs anqicms

    If you want to view it in real time, you can add-fparameters:docker logs -f anqicms

  • Pass through the 1Panel or aaPanel panel:These graphical management panels usually provide convenient container log viewing functions.

    1. Log in to your 1Panel or aaPanel dashboard.
    2. Navigate to the 'Container' or 'Docker' management interface.
    3. Find the AnQiCMS container you have deployed, click to view the details or log options.
    4. The panel displays the container's real-time logs or historical logs in a friendly interface, and usually provides search, filter, and download functions.

Log path under local test environment of Windows/MacOS

When developing and testing locally on Windows or MacOS systems, the situation is usually simpler:

  • Run the executable file directly:If you are double-clicking directlyanqicms.exe(Windows) oranqicmsTo run the program on (MacOS), any standard output and errors will usually be displayed directly in the command line window (Console).Please do not close the window immediately after the program runs so that you can observe the log information.
  • Simulate Linux script deployment:Although not common, if you use something similar on Windows or MacOS,start.shThe script (e.g., using WSL or a terminal emulator) to start AnQiCMS, then the log file will also be generated according to the redirection rules of the script, in the directory of the executable file, which is usually alsorunning.log.

What should you pay attention to when viewing log content?

No matter where the log file is stored, you should pay special attention to the following keywords when viewing:

  • ERRORorerror
  • FATALorfatal
  • PANICorpanic
  • WARNorwarning
  • Failedorfailed
  • SQL(May indicate database connection or operation issues)
  • connection refused(commonly occurs due to database or port connection failure)
  • Timestamp: This can help you determine the specific time when the problem occurred, narrowing down the troubleshooting scope.
  • Stack Trace: This is usually the code execution path printed when the program crashes, which can accurately point to the source of the problem.

By systematically searching and analyzing these logs, you will be able to diagnose the program errors encountered by AnQiCMS more efficiently and accurately, thus quickly restoring the normal operation of the website.


Frequently Asked Questions (FAQ)

  1. Ask: AnQiCMS program cannot start,running.logThere is nothing in the file, how should I investigate? Answer:Ifrunning.logEmpty, usually means that the program has not even started successfully to the stage where it can write logs, or there is a problem with the log redirection configuration. In this case, you need to check several aspects:
    • Executable file permissions:Ensure that the AnQiCMS executable file (such asanqicms) has execution permissions. On Linux, you can usechmod +x anqicmscommand to assign permissions.
    • The problem with starting the script:Checkstart.shIs the syntax of the script incorrect, or is the defined$BINPATHand$BINNAMEVariable pointing to the correct file.
    • Port occupied:AnQiCMS uses the default port 8001. If this port is occupied by another program, AnQiCMS will not start. You can uselsof -i:8001(Linux) or check the Task Manager (Windows) to check for port usage. If the port is occupied, you may need toconfig.jsonChange the running port of AnQiCMS and update your Nginx/Apache proxy configuration accordingly.
    • System environment dependencies:Check your

Related articles

When deploying AnQiCMS with Baota panel, which folder should the Nginx running directory be configured to?

As an experienced website operation expert, I am happy to give you a detailed explanation of the correct configuration method of the Nginx running directory when deploying AnQiCMS with Baota panel, and to analyze the principles behind it in depth to ensure that you not only know the what, but also the why. --- ### When deploying AnQiCMS with Baota panel, which directory should the Nginx running directory be configured to?Deep analysis and practice Deploying AnQiCMS and such Go language applications using Baota panel

2025-11-06

How to view the root directory path of the AnQiCMS container in Docker environment?

When deploying AnQiCMS with Docker, you may sometimes encounter situations where you need to explore its internal file structure, such as locating the actual root directory path of the website.This is very important for troubleshooting file access issues, performing manual file modifications, or deeply understanding the operation mechanism of AnQiCMS within the container.As a website operations expert, I fully understand the value of this exploration. Next, let's unveil the 'mysterious veil' of the root directory of the AnQiCMS container website.

2025-11-06

What is the actual file path represented by variables like `{filename}` or `{catname}` in static rules?

## Unveiling the 'mysterious code' in AnQi CMS static rules: the truth about `{filename}` and `{catname}` As an experienced website operations expert, I am well aware that a friendly and efficient URL structure is crucial for a website's search engine optimization (SEO) and user experience.AnQiCMS (AnQiCMS) provides strong support in this aspect, especially its flexible static rule management function.However, when configuring these rules

2025-11-06

How should mobile template files be organized and stored when making a mobile phone template?

As an experienced website operations expert, I know how important it is to have a good mobile website experience in today's mobile internet age.Users are accustomed to browsing content on various mobile devices. If your website does not display well on mobile phones, it will not only lose users but will also affect the search engine rankings.AnQiCMS (AnQiCMS) is an efficient and customizable content management system that also provides clear and flexible solutions for mobile template design.Today, let's delve into it in detail when making mobile templates with Anqi CMS

2025-11-06

How to distinguish the file path of `config.` for different sites in multi-site configuration?

AnQiCMS (AnQiCMS) is an efficient and flexible content management system, and its multi-site management function is undoubtedly a highlight favored by many operators.However, when it comes to multi-site configuration, some seemingly basic details, such as how to differentiate the `config.` file paths of different sites, often raise questions among users.Today, let's delve into this topic in depth to help everyone clearly understand the configuration logic of AnQiCMS under multi-site architecture.

2025-11-06

Where is the actual storage path of these image resources after I upload them to the background?

As an experienced website operation expert, I know the importance of image resource management for website performance, SEO, and even user experience.AnQiCMS (AnQiCMS) has made many meticulous designs in this aspect, allowing content operators to manage these valuable visual assets more efficiently.Today, let's delve deeply into a question that concerns everyone: 'Where are the actual storage paths of the image resources after I upload them to the backend?'}]

2025-11-06

How to set up the background to view or modify the specific URL address of the website logo image?

As an experienced website operations expert, I am well aware of the importance of the website logo to the brand image.It is not only the 'front door' of the website, but also a key element for users to identify your brand.In a powerful content management system like AnQiCMS, managing the website logo image address is a fundamental and frequent operation.Today, let's delve into how to easily view or modify the specific URL address of the website logo image through backend settings.

2025-11-06

Which file path variables are available when customizing the static rules?

Hello! As an old soldier who has been deeply involved in website operations for many years, I know that a flexible and powerful static mechanism is crucial for the website's search engine optimization (SEO) and user experience.AnQiCMS (AnQi CMS) performs very well in this aspect, it not only provides a variety of out-of-the-box static mode, but also allows for deep customization of URL structure, which undoubtedly provides great convenience for refined operation.Today, let's delve into the discussion of which key file path variables we can flexibly use when customizing pseudo-static rules in Anqi CMS

2025-11-06