# Study plan for 12/08/2022, by Sergii:
- [2nd Task](https://hackmd.io/UeyEfDnORPO0XbOw4Dpq5Q?view) Need to find in the source code what function called the log.
- [x] Result/Goals
- [x] Deadline 12.08.22
:::success
**References**
- [SA: OAI DU & CU](https://hackmd.io/UeyEfDnORPO0XbOw4Dpq5Q?view)
- [openairinterface5G](https://gitlab.eurecom.fr/oai/openairinterface5g.git)
:::
# Introduction in Logs:
/var/log/syslog or /var/log/messages: general messages, as well as system-related information. Essentially, this log stores all activity data across the global system. Note that activity for Redhat-based systems, such as CentOS or Rhel, are stored in messages, while Ubuntu and other Debian-based systems are stored in Syslog.
/var/log/auth.log or /var/log/secure: store authentication logs, including both successful and failed logins and authentication methods. Again, the system type dictates where authentication logs are stored; Debian/Ubuntu information is stored in /var/log/auth.log, while Redhat/CentrOS is stored in /var/log/secure.
/var/log/boot.log: a repository of all information related to booting and any messages logged during startup.
/var/log/maillog or var/log/mail.log: stores all logs related to mail servers, useful when you need information about postfix, smtpd, or any email-related services running on your server.
/var/log/kern: stores Kernel logs and warning data. This log is valuable for troubleshooting custom kernels as well.
/var/log/dmesg: messages relating to device drivers. The command dmesg can be used to view messages in this file.
/var/log/faillog: contains information all failed login attempts, which is useful for gaining insights on attempted security breaches, such as those attempting to hack login credentials as well as brute-force attacks.
/var/log/cron: stores all Crond-related messages (cron jobs), such as when the cron daemon initiated a job, related failure messages, etc.
/var/log/yum.log: if you install packages using the yum command, this log stores all related information, which can be useful in determining whether a package and all components were correctly installed.
/var/log/httpd/: a directory containing error_log and access_log files of the Apache httpd daemon. The error_log contains all errors encountered by httpd. These errors include memory issues and other system-related errors. access_log contains a record of all requests received over HTTP.
/var/log/mysqld.log or /var/log/mysql.log : MySQL log file that logs all debug, failure and success messages. Contains information about the starting, stopping and restarting of MySQL daemon mysqld. This is another instance where the system dictates the directory; RedHat, CentOS, Fedora, and other RedHat-based systems use /var/log/mysqld.log, while Debian/Ubuntu use the /var/log/mysql.log directory.
:::spoiler Detail of `openairinterface5g/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf`
```shell=
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
drb_ciphering = "yes";
drb_integrity = "no";
};
***logconfig :
{
globalloglevel ="info";
hwloglevel ="info";
phyloglevel ="info";
macloglevel ="info";
rlcloglevel ="debug";
pdcploglevel ="info";
rrcloglevel ="info";
f1aploglevel ="debug";
ngaploglevel ="debug";
};*
```
:::
The source code what function called the log
:::spoiler Detail of `openairinterface5g/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf`
```shell=
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
rfsimulator: {
serveraddr = "server";
serverport = "4043";
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs"
}
log_config :
{
global_log_level ="info";
hw_log_level ="info";
phy_log_level ="info";
mac_log_level ="info";
rlc_log_level ="info";
pdcp_log_level ="info";
rrc_log_level ="info";
f1ap_log_level ="debug";
ngap_log_level ="debug";
};
```
:::
The source code what function called the log
# In addition:
Linux logs will display with the command cd/var/log. Then, you can type ls to see the logs stored under this directory. One of the most important logs to view is the syslog, which logs everything but auth-related messages.
Issue the command var/log/syslog to view everything under the syslog. Zooming in on a specific issue will take a while, since these files tend to be long. You can use Shift+G to get to the end of the file, denoted by “END.”
You can also view logs via dmesg, which prints the kernel ring buffer and sends you to the end of the file. From there, you can use the command dmesg | less to scroll through the output. If you want to view log entries for the user facility, you need to issue the command dmesg –facility=user.
Lastly, you can use the tail command to view log files. It’s a handy tool that only shows the last part of the logs, where problems usually lie. For this, use the command tail /var/log/syslog or tail -f /var/log/syslog. tail will continue watching the log file and print out the next line written to the file. This allows you to follow what is written to syslog as it happens. Check out 20 ways to tail a log file post.
For a specific number of lines (example, the last 5 lines), key in tail -f -n 5 /var/log/syslog, which prints the most recent 5 lines. Once a new line comes, the old one gets removed. To escape the tail command, press Ctrl+X.
## Conclusion:
From the terminal code below, we can see in the cu_gnb.conf and du_gnb.conf that the source code has log function: globalloglevel; hwloglevel;phyloglevel; macloglevel; rlcloglevel; pdcploglevel; cloglevel; f1aploglevel; ngaploglevel.