Editing
Testing
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== local server node (if you has permission to log in the server via SSH or Remote desktop service) == check the server/service logs === OS === ==== Microsoft Windows ==== ** XP / Vista: 控制台 --> 系統管理工具 --> 事件檢視器 ** [http://www.microsoft.com/technet/support/ee/ee_basic.aspx 事件和錯誤訊息中心: 基本搜尋] === Web server === ==== Apache ==== [http://httpd.apache.org/ Apache HTTP server] log: /etc/httpd/logs (location was set up in the configuration file /etc/httpd/conf/httpd.conf) * access.log * error.log - record when the apache service restarted/stopped Using grep command to search the logs: {{kbd | key=<nowiki>grep -ir "string to search" /path/to/directory</nowiki>}}. More on [[Desktop_search#Search_text_in_files| Search text in files]] ==== IIS ==== [http://www.iis.net/ Microsoft Internet Information Services] (IIS) log (記錄檔)<ref>[http://www.dotblogs.com.tw/jimmyyu/archive/2009/06/26/9006.aspx (ASP.NET)從Log追蹤錯誤 - gipi的學習筆記-職場規劃、專案管理、雲端運算部落格- 點部落]</ref> * C:\WINDOWS\system32\LogFiles\ === Database server === ==== MySQL ==== [http://dev.mysql.com/doc/refman/5.1/en/server-logs.html MySQL Server Logs]: * step1: verify the system variable<ref>[https://dev.mysql.com/doc/refman/5.7/en/show-variables.html MySQL :: MySQL 5.7 Reference Manual :: 13.7.5.39 SHOW VARIABLES Syntax]</ref> <pre> mysql> SHOW VARIABLES LIKE '%general_log%'; mysql> SHOW GLOBAL VARIABLES LIKE '%general_log%'; </pre> * step2: enable logging /var/log/mysql.log (location was set up in the configuration file /etc/my.cnf or my.ini) <ref>[http://blog.longwin.com.tw/2005/10/mysql_query_slow_find/ 找出 MySQL 哪些 Query 速度較慢 | Tsung's Blog]</ref> <pre> [mysqld] ## includes all SQL queries/commands # general_log = 1 # general_log_file="general_log_file.log" log-error=/var/log/mysql/error.log log-slow-queries = /var/log/mysql/mysql-slow.log #another syntax #slow_query_log_file = mysql-slow.log long_query_time = 1 log-long-format </pre> * step3: restart MySQL service ==== Microsoft SQL Server ==== * [http://expressprofiler.codeplex.com/ ExpressProfiler] includes all SQL queries/commands * [http://msdn.microsoft.com/en-us/library/ms187109.aspx SQL Server Error Log] / [http://msdn.microsoft.com/zh-tw/library/ms187885(v=sql.105).aspx 檢視 SQL Server 錯誤記錄] "contains user-defined events and certain system events ..." quoted from [http://msdn.microsoft.com/en-us/library/ms187109.aspx SQL Server Error Log] ex: X:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Log\ERRORLOG * [http://stackoverflow.com/questions/123781/logging-all-queries-on-a-sql-server-2008-express-database Logging ALL Queries on a SQL Server 2008 Express Database? - Stack Overflow] ''not tested'' === Other === ==== PHP ==== [[PHP_errors#logging]] ==== Java ==== <pre> System.out.println("Boston, We Have A Problem" + variable); //output to Tomcat consile out.println("Boston, We Have A Problem" + variable); //output to JSP webpage </pre> or using [https://netbeans.org/features/java/debugger.html NetBeans IDE - Debugger and Profiler] to setup the breakpoints. ==== console command ==== <pre> //write the console output to the file command > log.txt //append to the same file command >> log.txt </pre>
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information