2

I am trying to use an environment variable in the odoo.conf file to specify the path where the logs are stored. So far I have tried:

logfile = ${test.rueda}/odoo.log

But it does not work. Is there any way to achieve this?

Dayana
  • 1,500
  • 1
  • 16
  • 29
  • The configuration file for the odoo is at `$HOME/.odoorc` or try giving the logging file path using `--logfile ` while running the binary. – Hamza Anis Sep 04 '18 at 02:15

2 Answers2

4

The Odoo configuration files do not support access to environment variables.

I can think of 2 possible approaches:

  • Use relative paths. The file names in the configuration are relative to the working directory of the Odoo server process. Start the Odoo server in different directories, one for every purpose, and keep the same structure relative to that.

  • Use environment variables in the command line. When starting the Odoo server, any configuration option can be passed using -- (2 dash signs) as a prefix. In the start script, you can then use environment variables as in any other shell script. See https://www.odoo.com/documentation/11.0/reference/cmdline.html for details.

miw
  • 776
  • 4
  • 11
1

For referencing files or path:

When i work without external disk (where i can find my datadir): i use in odoo config file data_dir = my_absolute_path_in_my_local_disk.

This path have a symbolic redirection to where is my local physical location of my local data directory

When my external disk come back, i change the symbolic link:

my_absolute_path_in_my_local_disk -> my_external_disk_..._data
Ryan M
  • 18,333
  • 31
  • 67
  • 74